Skip to content

Commit

Permalink
Fix mistake using jsonresponse with a str.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkmarx committed Feb 6, 2018
1 parent 39ba7e9 commit 404345c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions refinery/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,10 @@ def solr_select(request, core):
full_response.raise_for_status()
except HTTPError as e:
logger.error(e)
response = json.dumps({})
return JsonResponse({})
else:
response = full_response.content
return JsonResponse(response)
return HttpResponse(full_response.content,
content_type='application/json')

This comment has been minimized.

Copy link
@hackdna

hackdna Feb 7, 2018

Member

It is safer to deserialize full_response.content string into a Python dict using json.loads() (to make sure it is valid JSON) then use that dict with JsonResponse()



def solr_igv(request):
Expand Down

0 comments on commit 404345c

Please sign in to comment.