Commit 933be3fb authored by Fabian-Andree Heidemann's avatar Fabian-Andree Heidemann
Browse files

[JSONdata] fix wid usage with None and -1

parent faa215b1
......@@ -81,10 +81,11 @@ class AjaxController(AbstractController):
# json
@cherrypy.expose
@cherrypy.tools.method(accept="POST")
def setjson(self, key, value, wid=None):
def setjson(self, key, value, wid=-1):
db = cherrypy.request.db
user_id = self.get("user_id")
wid = int(wid)
wid = None if wid == -1 else wid
JSONData.set_value(db,
user_id =user_id,
key =key,
......@@ -98,6 +99,7 @@ class AjaxController(AbstractController):
db = cherrypy.request.db
user_id = self.get("user_id")
wid = int(wid)
wid = None if wid == -1 else wid
return JSON.dumps(JSONData.get_value(db,
user_id =user_id,
key =key,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment