summaryrefslogtreecommitdiff
path: root/src/leap/gui
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-11-06 16:35:48 +0900
committerkali <kali@leap.se>2012-11-06 16:35:48 +0900
commit00009f8a7de957c4d53c10855cae1396108203c3 (patch)
tree58d4b40487e2b5213fe1753d834f0c10cb76cc06 /src/leap/gui
parentad16a72f60ecc84524c22e8912df4eb8a48a2a42 (diff)
add 404 catch to register
Diffstat (limited to 'src/leap/gui')
-rw-r--r--src/leap/gui/firstrun/register.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/leap/gui/firstrun/register.py b/src/leap/gui/firstrun/register.py
index b04844bf..b169f45b 100644
--- a/src/leap/gui/firstrun/register.py
+++ b/src/leap/gui/firstrun/register.py
@@ -101,6 +101,7 @@ class RegisterUserPage(QtGui.QWizardPage, UserFormMixIn):
"Register a new user with provider %s." %
provider)
self.validationMsg.setText('')
+ self.userPassword2LineEdit.setText('')
def validatePage(self):
"""
@@ -110,12 +111,6 @@ class RegisterUserPage(QtGui.QWizardPage, UserFormMixIn):
returned we write validation error msg
above the form.
"""
- # the slot for this signal is not doing
- # what's expected. Investigate why,
- # right now we're not giving any feedback
- # to the user re. what's going on. The only
- # thing I can see as a workaround is setting
- # a low timeout.
wizard = self.wizard()
self.setSigningUpStatus.emit()
@@ -124,7 +119,9 @@ class RegisterUserPage(QtGui.QWizardPage, UserFormMixIn):
password = self.userPasswordLineEdit.text()
password2 = self.userPassword2LineEdit.text()
- # have some call to a password checker...
+ # we better have here
+ # some call to a password checker...
+ # to assess strenght and avoid silly stuff.
if password != password2:
self.set_validation_status('Password does not match.')
@@ -161,7 +158,9 @@ class RegisterUserPage(QtGui.QWizardPage, UserFormMixIn):
else:
# this is the real thing
signup = auth.LeapSRPRegister(
- # XXX FIXME 0 Force HTTPS
+ # XXX FIXME FIXME FIXME FIXME
+ # XXX FIXME 0 Force HTTPS !!!
+ # XXX FIXME FIXME FIXME FIXME
#schema="https",
schema="http",
provider=domain)
@@ -191,6 +190,11 @@ class RegisterUserPage(QtGui.QWizardPage, UserFormMixIn):
"Error during registration (500)")
return False
+ if req.status_code == 404:
+ self.set_validation_status(
+ "Error during registration (404)")
+ return False
+
validation_msgs = json.loads(req.content)
logger.debug('validation errors: %s' % validation_msgs)
errors = validation_msgs.get('errors', None)