diff --git a/participation/views.py b/participation/views.py index 1483d9f..2c25bb7 100644 --- a/participation/views.py +++ b/participation/views.py @@ -810,10 +810,14 @@ class PoolUploadNotesView(VolunteerMixin, FormView, DetailView): pool = self.get_object() parsed_notes = form.cleaned_data['parsed_notes'] - for vr, notes in parsed_notes.items(): + for vr in parsed_notes.keys(): if vr not in pool.juries.all(): form.add_error('file', _("The following user is not registered as a jury:") + " " + str(vr)) + if form.errors: + return self.form_invalid(form) + + for vr, notes in parsed_notes.items(): # There is an observer note for 4-teams pools notes_count = 7 if pool.passages.count() == 4 else 6 for i, passage in enumerate(pool.passages.all()):