fixed Issue 1563:Web2py in error when the request contains a json string corresponding to a list, thanks Hono Sandai

This commit is contained in:
mdipierro committed 2013-06-27 01:51:03 -05:00
1 parent 92757a4e2b
commit 768b49224c
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -1 +1 @@
Version 2.6.0-development+timestamp.2013.06.26.05.11.38 Version 2.6.0-development+timestamp.2013.06.27.01.50.11
+2 -1
View File
@@ -339,6 +339,7 @@ def parse_get_post_vars(request, environ):
json_vars = {} json_vars = {}
pass pass
# update vars and get_vars with what was posted as json # update vars and get_vars with what was posted as json
if isinstance(json_vars,dict):
request.get_vars.update(json_vars) request.get_vars.update(json_vars)
request.vars.update(json_vars) request.vars.update(json_vars)
@@ -386,7 +387,7 @@ def parse_get_post_vars(request, environ):
if len(pvalue): if len(pvalue):
request.post_vars[key] = (len(pvalue) > request.post_vars[key] = (len(pvalue) >
1 and pvalue) or pvalue[0] 1 and pvalue) or pvalue[0]
if is_json: if is_json and isinstance(json_vars,dict):
# update post_vars with what was posted as json # update post_vars with what was posted as json
request.post_vars.update(json_vars) request.post_vars.update(json_vars)