~nataliabidart/ubuntu-sso-client/move-ping

« back to all changes in this revision

Viewing changes to ubuntu_sso/main/windows.py

  • Committer: Natalia B. Bidart
  • Date: 2012-02-09 21:17:54 UTC
  • Revision ID: natalia.bidart@canonical.com-20120209211754-6hmk8hkg1jy80v86
- Move the ping_url code to utils, and make the UserManagement service use it
  (LP: #929670).

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        'generate_captcha',
95
95
        'register_user',
96
96
        'login',
 
97
        'login_and_ping',
97
98
        'validate_email',
 
99
        'validate_email_and_ping',
98
100
        'request_password_reset_token',
99
101
        'set_new_password',
100
102
    ]
144
146
    def UserNotValidated(self, app_name, result):
145
147
        """Signal thrown when the user is not validated."""
146
148
 
147
 
    def login(self, app_name, email, password):
 
149
    def login(self, app_name, email, password, ping_url=None):
148
150
        """Call the matching method in the processor."""
149
 
        self.root.sso_login.login(app_name, email, password)
 
151
        self.root.sso_login.login(app_name, email, password, ping_url)
 
152
 
 
153
    login_and_ping = login
150
154
 
151
155
    # validate_email signals
152
156
    @signal
157
161
    def EmailValidationError(self, app_name, error):
158
162
        """Signal thrown when there's a problem validating the email."""
159
163
 
160
 
    def validate_email(self, app_name, email, password, email_token):
 
164
    def validate_email(self, app_name, email, password, email_token,
 
165
                       ping_url=None):
161
166
        """Call the matching method in the processor."""
162
167
        self.root.sso_login.validate_email(app_name,
163
 
            email, password, email_token)
 
168
            email, password, email_token, ping_url)
 
169
 
 
170
    validate_email_and_ping = validate_email
164
171
 
165
172
    # request_password_reset_token signals
166
173
    @signal