summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-12-18 06:09:57 +0900
committerkali <kali@leap.se>2012-12-18 06:09:57 +0900
commitef3e6f7badf4d477e796f8522b4d79b554f18f93 (patch)
tree0e25ec5837d69f99341be67523f0de5c1dc006da /src/leap
parent2be35ae3a89071df58bae2513d0a7e9a68239f57 (diff)
back-compat fix for requests api change
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/base/config.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/leap/base/config.py b/src/leap/base/config.py
index b307ad05..438d1993 100644
--- a/src/leap/base/config.py
+++ b/src/leap/base/config.py
@@ -209,7 +209,12 @@ class JSONLeapConfig(BaseLeapConfig):
if last_modified:
_mtime = dateparser.parse(last_modified)
mtime = int(_mtime.strftime("%s"))
- self._config.load(json.dumps(request.json), mtime=mtime)
+ if callable(request.json):
+ _json = request.json()
+ else:
+ # back-compat
+ _json = request.json
+ self._config.load(json.dumps(_json), mtime=mtime)
self._config.set_dirty()
else:
# not request.json