summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-08-18 12:23:02 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-08-18 12:47:00 (GMT)
commit86519bca0e02e78209fac3c4825c22367e2128a6 (patch)
tree9a67ab641a877dc595290b312633cfa51012b6a6
parent5bb06f82001b0b2b576902b0835098ae4904f9ce (diff)
downloadcombo-wip/35425-python3-bis.zip
combo-wip/35425-python3-bis.tar.gz
combo-wip/35425-python3-bis.tar.bz2
manager: force imported json to be read as text (#35425)wip/35425-python3-bis
-rw-r--r--combo/manager/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/combo/manager/views.py b/combo/manager/views.py
index bae8a64..9d21184 100644
--- a/combo/manager/views.py
+++ b/combo/manager/views.py
@@ -74,7 +74,7 @@ class SiteImportView(FormView):
def form_valid(self, form):
try:
- json_site = json.load(self.request.FILES['site_json'])
+ json_site = json.loads(force_text(self.request.FILES['site_json'].read()))
except ValueError:
form.add_error('site_json', _('File is not in the expected JSON format.'))
return self.form_invalid(form)