From 453a4abc87f957a96fcf68fa0ad625d27c5e73e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Mon, 11 Mar 2013 18:22:19 -0300 Subject: Prepend username if the error message doesn't start with uppercase --- src/leap/gui/wizard.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/leap/gui') 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): -- cgit v1.2.3