manager: force imported json to be read as text (#35425)
This commit is contained in:
parent
5bb06f8200
commit
86519bca0e
|
@ -74,7 +74,7 @@ class SiteImportView(FormView):
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
try:
|
try:
|
||||||
json_site = json.load(self.request.FILES['site_json'])
|
json_site = json.loads(force_text(self.request.FILES['site_json'].read()))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
form.add_error('site_json', _('File is not in the expected JSON format.'))
|
form.add_error('site_json', _('File is not in the expected JSON format.'))
|
||||||
return self.form_invalid(form)
|
return self.form_invalid(form)
|
||||||
|
|
Loading…
Reference in New Issue