manager: force imported json to be read as text (#35425)

This commit is contained in:
Frédéric Péters 2019-08-18 14:23:02 +02:00
parent 5bb06f8200
commit 86519bca0e
1 changed files with 1 additions and 1 deletions

View File

@ -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)