Merge branch 'kerl/fix_exte_login_bug' into 'master'
Meilleure gestion des erreurs dans le formulaire de login Exté → pas de crash See merge request klub-dev-ens/gestioCOF!455
This commit is contained in:
commit
34be9e2393
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