summaryrefslogtreecommitdiff
path: root/src/leap/gui/wizard.py
diff options
context:
space:
mode:
authorTomas Touceda <chiiph@leap.se>2013-05-10 17:01:11 -0300
committerkali <kali@leap.se>2013-05-11 21:59:59 +0900
commit4e201329042d43c8d281c5737d3d5f6f8e2bf67f (patch)
tree3cf5dea6f0d1e2800932ae23340ded46d0df1659 /src/leap/gui/wizard.py
parentc533900a43f5006e6b4cb9d070b4bd30fb67f0b5 (diff)
Add support for requests<1.0.0
Diffstat (limited to 'src/leap/gui/wizard.py')
-rw-r--r--src/leap/gui/wizard.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/leap/gui/wizard.py b/src/leap/gui/wizard.py
index ad45dd8c..713383a6 100644
--- a/src/leap/gui/wizard.py
+++ b/src/leap/gui/wizard.py
@@ -20,6 +20,7 @@ First run wizard
"""
import os
import logging
+import json
from PySide import QtCore, QtGui
from functools import partial
@@ -28,6 +29,7 @@ from ui_wizard import Ui_Wizard
from leap.config.providerconfig import ProviderConfig
from leap.crypto.srpregister import SRPRegister
from leap.util.privilege_policies import is_missing_policy_permissions
+from leap.util.request_helpers import get_content
from leap.services.eip.providerbootstrapper import ProviderBootstrapper
logger = logging.getLogger(__name__)
@@ -254,7 +256,9 @@ class Wizard(QtGui.QWizard):
self._password = None
error_msg = self.tr("Unknown error")
try:
- error_msg = req.json().get("errors").get("login")[0]
+ content, _ = get_content(req)
+ json_content = json.loads(content)
+ error_msg = json_content.get("errors").get("login")[0]
if not error_msg.istitle():
error_msg = "%s %s" % (old_username, error_msg)
self._set_register_status(error_msg, error=True)