Merge pull request #67 from mistercrunch/fix_debug_dup_call

Fix debug mode calls get_json twice
This commit is contained in:
Maxime Beauchemin 2015-11-30 13:48:11 -08:00
commit 525bd509cb
1 changed files with 8 additions and 7 deletions

View File

@ -352,15 +352,16 @@ class Panoramix(BaseView):
datasource,
form_data=request.args)
if request.args.get("json") == "true":
status = 200
if config.get("DEBUG"):
payload = obj.get_json()
try:
payload = obj.get_json()
status=200
except Exception as e:
logging.exception(e)
payload = str(e)
status=500
else:
try:
payload = obj.get_json()
except Exception as e:
logging.exception(e)
payload = str(e)
status = 500
return Response(
payload,
status=status,