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

« back to all changes in this revision

Viewing changes to ubuntu_sso/utils/ui.py

  • Committer: Tarmac
  • Author(s): Manuel de la Pena, ralsina, Roberto Alsina
  • Date: 2011-04-14 17:01:56 UTC
  • mfrom: (705.2.2 forgotten_password)
  • Revision ID: tarmac-20110414170156-4k8s1708gzgj5oi2
Fixes lp:753281

Adds the required UI and backend to allow a windows user to reset his sso password from the Windows client. Tests have been added to ensure that the backend is correctly called.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
                       'enter your details below.')
40
40
EMAIL1_ENTRY = _('Email address')
41
41
EMAIL2_ENTRY = _('Re-type Email address')
 
42
EMAIL_LABEL = EMAIL1_ENTRY + ':'
42
43
EMAIL_MISMATCH = _('The email addresses don\'t match, please double check '
43
44
                       'and try entering them again.')
44
45
EMAIL_INVALID = _('The email must be a valid email address.')
66
67
PASSWORD_TOO_WEAK = _('The password is too weak.')
67
68
REQUEST_PASSWORD_TOKEN_LABEL = _('To reset your %(app_name)s password,'
68
69
                                 ' enter your email address below:')
 
70
REQUEST_PASSWORD_TOKEN_WRONG_EMAIL = _('Sorry we did not recognize the email'
 
71
                                       ' address.')
 
72
REQUEST_PASSWORD_TOKEN_TECH_ERROR = _('We are very Sorry! The service that'
 
73
                                      ' signs you on is not responding right'
 
74
                                      ' now\nPlease try again or come back in'
 
75
                                      ' a few minutes.')
69
76
RESET_PASSWORD = _('Reset password')
70
77
RESET_CODE_ENTRY = _('Reset code')
71
78
RESET_EMAIL_ENTRY = _('Email address')
80
87
TC_BUTTON = _('Show Terms & Conditions')
81
88
TC_NOT_ACCEPTED = _('Agreeing to the Ubuntu One Terms & Conditions is ' \
82
89
                        'required to subscribe.')
 
90
TRY_AGAIN_BUTTON = _('Try again')
83
91
UNKNOWN_ERROR = _('There was an error when trying to complete the ' \
84
92
                      'process. Please check the information and try again.')
85
93
VERIFY_EMAIL_TITLE = _('Enter verification code')
168
176
        re.search('\d+', password) is None):
169
177
        return False
170
178
    return True
 
179
 
 
180
 
 
181
def is_correct_email(email_address):
 
182
    """Return if the email is correct."""
 
183
    return '@' in email_address