misc: adapt to Python 3.5 json module requiring strings (#25985)

This commit is contained in:
Frédéric Péters 2018-10-05 10:48:54 +02:00
parent 5f499722cc
commit 3810c1ec74
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ class AgendasImportView(FormView):
def form_valid(self, form):
try:
agendas_json = json.load(self.request.FILES['agendas_json'])
agendas_json = json.loads(force_text(self.request.FILES['agendas_json'].read()))
except ValueError:
form.add_error('agendas_json', _('File is not in the expected JSON format.'))
return self.form_invalid(form)