summaryrefslogtreecommitdiff
path: root/src/leap/gui
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-11 18:22:19 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-11 18:22:19 -0300
commit453a4abc87f957a96fcf68fa0ad625d27c5e73e6 (patch)
tree96d54435c462104c7a97014d6546d4469def3ba7 /src/leap/gui
parent77c7e96e2aad4db223e4c7af53ec300d5472829b (diff)
Prepend username if the error message doesn't start with uppercase
Diffstat (limited to 'src/leap/gui')
-rw-r--r--src/leap/gui/wizard.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/leap/gui/wizard.py b/src/leap/gui/wizard.py
index 70028581..86e0dcfd 100644
--- a/src/leap/gui/wizard.py
+++ b/src/leap/gui/wizard.py
@@ -210,14 +210,17 @@ class Wizard(QtGui.QWizard):
self.page(self.REGISTER_USER_PAGE).set_completed()
self.button(QtGui.QWizard.BackButton).setEnabled(False)
else:
+ old_username = self._username
self._username = None
self._password = None
error_msg = self.tr("Unknown error")
try:
error_msg = req.json().get("errors").get("login")[0]
+ if not error_msg.istitle():
+ error_msg = "%s %s" % (old_username, error_msg)
+ self._set_register_status(error_msg)
except:
logger.error("Unknown error: %r" % (req.content,))
- self._set_register_status(error_msg)
self.ui.btnRegister.setEnabled(True)
def _set_register_status(self, status):