From ef3e6f7badf4d477e796f8522b4d79b554f18f93 Mon Sep 17 00:00:00 2001 From: kali Date: Tue, 18 Dec 2012 06:09:57 +0900 Subject: back-compat fix for requests api change --- src/leap/base/config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/leap/base') 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 -- cgit v1.2.3