~nataliabidart/ubuntu-sso-client/all-ui-from-code

« back to all changes in this revision

Viewing changes to ubuntu_sso/qt/current_user_sign_in_page.py

  • Committer: Tarmac
  • Author(s): Diego Sarmentero
  • Date: 2012-02-13 15:42:05 UTC
  • mfrom: (858.2.2 ubuntu-sso-client-930724)
  • Revision ID: tarmac-20120213154205-nusgai8bogpj42xg
- Fixed: Qt UI: when calling login or validate_email, should pass the ping_url (LP: #930724).

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    passwordForgotten = QtCore.pyqtSignal()
45
45
    userNotValidated = QtCore.pyqtSignal('QString', 'QString')
46
46
 
47
 
    def __init__(self, ui, *args, **kwargs):
 
47
    def __init__(self, ui, ping_url, *args, **kwargs):
48
48
        super(CurrentUserSignInPage, self).__init__(ui, *args, **kwargs)
 
49
        self.ping_url = ping_url
49
50
 
50
51
        self._signals = {
51
52
            'LoggedIn':
135
136
        # grab the data from the view and call the backend
136
137
        email = unicode(self.ui.email_edit.text())
137
138
        password = unicode(self.ui.password_edit.text())
138
 
        self.backend.login(self.app_name, email, password)
 
139
        args = (self.app_name, email, password)
 
140
        if self.ping_url:
 
141
            f = self.backend.login_and_ping
 
142
            args = args + (self.ping_url,)
 
143
        else:
 
144
            f = self.backend.login
 
145
        f(*args)
139
146
 
140
147
    def on_login_error(self, app_name, error):
141
148
        """There was an error when login in."""