~ubuntuone-control-tower/ubuntu-sso-client/trunk

« back to all changes in this revision

Viewing changes to ubuntu_sso/qt/controllers.py

  • Committer: Tarmac
  • Author(s): ralsina
  • Date: 2011-07-06 18:01:38 UTC
  • mfrom: (729.3.18 fix_805405)
  • Revision ID: tarmac-20110706180138-6nyniqgnyap2mtee
Fix an exception when the user entered the captcha wrong, show a message instead of a dict in another case.

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
        logger.error('Got error when login %s, error: %s',
201
201
                     self.view.wizard().app_name, error)
202
202
        self.message_box.critical(self.view, self.view.wizard().app_name,
203
 
                                  str(error))
 
203
                                  error['message'])
204
204
 
205
205
    def on_logged_in(self, app_name, result):
206
206
        """We managed to log in."""
353
353
    def on_user_registration_error(self, app_name, error):
354
354
        """Let the user know we could not register."""
355
355
        logger.debug('SetUpAccountController.on_user_registration_error')
356
 
        # error are returned as a dict with the data we want to show.
357
 
        self.message_box.critical(self.view, error['errtype'], error['email'])
 
356
        # errors are returned as a dict with the data we want to show.
 
357
        self._refresh_captcha()
 
358
        errors = [v for _, v in sorted(error.iteritems())]
 
359
        self.message_box.critical(
 
360
            self.view,
 
361
            self.view.wizard().app_name,
 
362
            '\n'.join(errors))
358
363
 
359
364
    def on_user_registered(self, app_name, result):
360
365
        """Execute when the user did register."""