~mvo/ubuntu-sso-client/strawman-lp711413

« back to all changes in this revision

Viewing changes to ubuntu_sso/gtk/gui.py

  • Committer: Tarmac
  • Author(s): Natalia B. Bidart
  • Date: 2012-04-11 18:03:04 UTC
  • mfrom: (836.1.1 fix-960657-stable-3-0)
  • Revision ID: tarmac-20120411180304-9v1oenrbk3mchxns
- When validating the registration screen (in the GTK+ UI), do not force
  accepting the T&C if the tc_url is not defined (LP: #960657).
- Added more logging entries to the registration screen (GTK+ UI) validation
  process.

Show diffs side-by-side

added added

removed removed

Lines of Context:
539
539
 
540
540
        msg = YES_TO_UPDATES % {'app_name': self.app_name}
541
541
        self.yes_to_updates_checkbutton.set_label(msg)
542
 
        if self.tc_url:
543
 
            msg = YES_TO_TC % {'app_name': self.app_name}
544
 
            self.yes_to_tc_checkbutton.set_label(msg)
545
 
            self.tc_button.set_label(TC_BUTTON)
546
 
        else:
 
542
 
 
543
        msg = YES_TO_TC % {'app_name': self.app_name}
 
544
        self.yes_to_tc_checkbutton.set_label(msg)
 
545
        self.tc_button.set_label(TC_BUTTON)
 
546
 
 
547
        if not self.tc_url:
547
548
            self.tc_vbox.hide()
548
549
        self.login_button.set_label(LOGIN_BUTTON_LABEL)
549
550
 
741
742
        name = self.name_entry.get_text()
742
743
        if not name:
743
744
            self.name_entry.set_warning(FIELD_REQUIRED)
 
745
            logger.warning('on_join_ok_button_clicked: name not set.')
744
746
            error = True
745
747
 
746
748
        # check email
750
752
        if msg is not None:
751
753
            self.email1_entry.set_warning(msg)
752
754
            self.email2_entry.set_warning(msg)
 
755
            logger.warning('on_join_ok_button_clicked: email is not valid.')
753
756
            error = True
754
757
 
755
758
        # check password
759
762
        if msg is not None:
760
763
            self.password1_entry.set_warning(msg)
761
764
            self.password2_entry.set_warning(msg)
 
765
            logger.warning('on_join_ok_button_clicked: password is not valid.')
762
766
            error = True
763
767
 
764
768
        # check T&C
765
 
        if not self.yes_to_tc_checkbutton.get_active():
 
769
        if self.tc_url and not self.yes_to_tc_checkbutton.get_active():
766
770
            self._set_warning_message(self.tc_warning_label,
767
771
                TC_NOT_ACCEPTED % {'app_name': self.app_name})
 
772
            logger.warning('on_join_ok_button_clicked: terms and conditions '
 
773
                           'not accepted.')
768
774
            error = True
769
775
 
770
776
        captcha_solution = self.captcha_solution_entry.get_text()
771
777
        if not captcha_solution:
772
778
            self.captcha_solution_entry.set_warning(FIELD_REQUIRED)
 
779
            logger.warning('on_join_ok_button_clicked: captcha solution not '
 
780
                           'set.')
773
781
            error = True
774
782
 
775
783
        if error:
 
784
            logger.warning('on_join_ok_button_clicked: validation failed.')
776
785
            return
777
786
 
 
787
        logger.info('on_join_ok_button_clicked: validation success!')
 
788
 
778
789
        self._set_current_page(self.processing_vbox)
779
790
        self.user_email = email1
780
791
        self.user_password = password1