Prevent a crash in exte login form error handling
This commit is contained in:
parent
8016b16904
commit
97bdeed97a
1 changed files with 1 additions and 3 deletions
|
@ -92,9 +92,7 @@ class LoginExtView(DjangoLoginView):
|
|||
form_class = ExteAuthenticationForm
|
||||
|
||||
def form_invalid(self, form):
|
||||
# forms.non_field_errors() returns strings for some reason
|
||||
non_field_errors = form.errors["__all__"].as_data()
|
||||
for e in non_field_errors:
|
||||
for e in form.non_field_errors().as_data():
|
||||
if e.code in ["has_clipper", "no_password"]:
|
||||
return render(self.request, "login_error.html", {"error_code": e.code})
|
||||
return super().form_invalid(form)
|
||||
|
|
Loading…
Reference in a new issue