Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added try/except around json.loads call to catch malformed json

  • Loading branch information...
commit 4f4c8554df6d2c30eff01cfaaa82dcf61e6c81b1 1 parent 111d6f1
@jeads jeads authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 datazilla/webapp/apps/datazilla/refdata/objectstore_views.py
View
11 datazilla/webapp/apps/datazilla/refdata/objectstore_views.py
@@ -41,11 +41,14 @@ def get_json_blob(request, project, id):
if blob:
- if not re.search('Malformed JSON', blob['error_msg'] or ""):
- # If we don't have malformed json load it so we can return
- # a single json data structure with all fields present including
- # json_blob. Malformed json will be returned as an escaped string.
+ # If we don't have malformed json load it so we can return
+ # a single json data structure with all fields present including
+ # json_blob. Malformed json will be returned as an escaped
+ # string.
+ try:
blob['json_blob'] = json.loads(blob['json_blob'])
+ except ValueError as e:
+ pass
return HttpResponse(json.dumps(blob), content_type=API_CONTENT_TYPE)
Please sign in to comment.
Something went wrong with that request. Please try again.