~ralsina/ubuntu-sso-client/find_exes

« back to all changes in this revision

Viewing changes to ubuntu_sso/qt/email_verification_page.py

- Improve logging operations (LP: #934500).

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
    def _connect_ui(self):
73
73
        """Set the connection of signals."""
74
 
        logger.debug('EmailVerificationController._connect_ui')
75
74
        self.ui.verification_code_edit.textChanged.connect(
76
75
            self.validate_form)
77
76
        self.next_button.clicked.connect(self.validate_email)
84
83
 
85
84
    def _set_translated_strings(self):
86
85
        """Set the different titles."""
87
 
        logger.debug('EmailVerificationController._set_titles')
88
86
        self.header.set_title(VERIFY_EMAIL_TITLE)
89
87
        self.header.set_subtitle(VERIFY_EMAIL_CONTENT % {
90
88
            "app_name": self.app_name,
103
101
 
104
102
    def validate_email(self):
105
103
        """Call the next action."""
106
 
        logger.debug('EmailVerificationController.validate_email')
 
104
        logger.debug('EmailVerificationController.validate_email for: %s',
 
105
            self.email)
107
106
        code = unicode(self.ui.verification_code_edit.text())
108
107
        args = (self.app_name, self.email, self.password, code)
109
108
        self.hide_error()
123
122
 
124
123
    def on_email_validated(self, app_name, email):
125
124
        """Signal thrown after the email is validated."""
126
 
        logger.info('EmailVerificationController.on_email_validated')
 
125
        logger.info('EmailVerificationController.on_email_validated for %s, '
 
126
                    'email: %s', app_name, email)
127
127
        self.hide_overlay()
128
128
        self.registrationSuccess.emit(self.email)
129
129
 
130
130
    def on_email_validation_error(self, app_name, error):
131
131
        """Signal thrown when there's a problem validating the email."""
 
132
        logger.error('Got error on email validation %s, error: %s',
 
133
            app_name, error)
132
134
        self.hide_overlay()
133
135
        msg = error.pop(ERROR_EMAIL_TOKEN, '')
134
136
        msg += build_general_error_message(error)
138
140
 
139
141
    def initializePage(self):
140
142
        """Called to prepare the page just before it is shown."""
 
143
        logger.debug('initializePage - About to show EmailVerificationPage')
141
144
        self.next_button.setDefault(True)
142
145
        self.next_button.setEnabled(False)
143
146
        self.wizard().setButtonLayout([QtGui.QWizard.Stretch])