From 5dd5f078988440bb500a1cde4c5e8f7f1c931163 Mon Sep 17 00:00:00 2001 From: Userland Alchemist Date: Wed, 20 Aug 2025 22:06:51 +0100 Subject: [PATCH] website: fix login banner showing before any attempt (fixes #3810) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- evennia/web/templates/website/registration/login.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evennia/web/templates/website/registration/login.html b/evennia/web/templates/website/registration/login.html index df506c641c..c13a9d7b67 100644 --- a/evennia/web/templates/website/registration/login.html +++ b/evennia/web/templates/website/registration/login.html @@ -16,7 +16,7 @@ {% if user.is_authenticated %} {% else %} - {% if form.errors %} + {% if form.is_bound and form.non_field_errors %} {% endif %} {% endif %}