Skip to content

Commit

Permalink
Added information on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Spitfireap committed Aug 18, 2024
1 parent 6cb0e80 commit d28819b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modoboa_webmail/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,12 +746,12 @@ def get_plain_password(request, tplname="modoboa_webmail/ask_password.html"):
form.cleaned_data["password"]
))
return redirect("modoboa_webmail:index")
return render_to_json_response({"form_errors": form.errors}, status=400)
form.add_error("password", _("Wrong password"))
return render(request, 'modoboa_webmail/ask_password.html', {'form': form})
if get_password(request) is not None:
return redirect("modoboa_webmail:index")
form = AskPassword()
context = {
'form': form,
}

return render(request, 'modoboa_webmail/ask_password.html', context)

0 comments on commit d28819b

Please sign in to comment.