dashboard: force json request to be read as text (#35425)
This commit is contained in:
parent
826acc3b24
commit
fb96c6d4f3
|
@ -22,6 +22,7 @@ from django.core.exceptions import PermissionDenied
|
|||
from django.core.urlresolvers import reverse
|
||||
from django.db.models import Max, Min
|
||||
from django.http import Http404, HttpResponse, HttpResponseRedirect
|
||||
from django.utils.encoding import force_text
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.views.generic import View
|
||||
|
||||
|
@ -117,7 +118,7 @@ def dashboard_auto_tile(request, *args, **kwargs):
|
|||
# only keep parameters that are actually defined for this cell type.
|
||||
cell_form_keys = [x['varname'] for x in settings.JSON_CELL_TYPES[cell.key].get('form') or {}]
|
||||
cell.parameters = {}
|
||||
request_body = json.loads(request.body)
|
||||
request_body = json.loads(force_text(request.body))
|
||||
for key in cell_form_keys:
|
||||
cell.parameters[key] = request_body.get(key)
|
||||
|
||||
|
|
Loading…
Reference in New Issue