mirror of
https://github.com/evennia/evennia.git
synced 2025-10-29 19:35:56 +00:00
website: fix login banner showing before any attempt (fixes #3810)
The login page template currently displays the red "Your username and password are incorrect. Please try again." banner whenever `form.errors` is truthy. This includes the initial GET request, so the error is visible before any credentials have been submitted. This patch gates the banner on `form.is_bound and form.non_field_errors`, which matches Django's intended semantics: - GET (unbound form) → no banner - POST with bad credentials (non_field_errors) → banner shown - POST with valid credentials → no banner The original banner text is preserved verbatim.
This commit is contained in:
parent
27f0ccec4a
commit
5dd5f07898
@ -16,7 +16,7 @@
|
||||
{% if user.is_authenticated %}
|
||||
<div class="alert alert-info" role="alert">You are already logged in!</div>
|
||||
{% else %}
|
||||
{% if form.errors %}
|
||||
{% if form.is_bound and form.non_field_errors %}
|
||||
<div class="alert alert-danger" role="alert">Your username and password are incorrect. Please try again.</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user