From 6b331888e959ff2166fc94c3696e7d7d13460254 Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Thu, 15 May 2025 13:19:25 +0200 Subject: [PATCH] [A11y] Fix missing errors on empty inputs on checkout-login (#5104) --- src/pretix/presale/forms/customer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pretix/presale/forms/customer.py b/src/pretix/presale/forms/customer.py index acddff83b6..9e95932451 100644 --- a/src/pretix/presale/forms/customer.py +++ b/src/pretix/presale/forms/customer.py @@ -66,6 +66,8 @@ class AuthenticationForm(forms.Form): error_messages = { 'incomplete': _('You need to fill out all fields.'), + 'empty_email': _('You need to enter an email address.'), + 'empty_password': _('You need to enter a password.'), 'invalid_login': _( "We have not found an account with this email address and password." ), @@ -112,6 +114,10 @@ class AuthenticationForm(forms.Form): else: self.confirm_login_allowed(self.customer_cache) else: + if not email: + self.add_error("email", self.error_messages['empty_email']) + if not password: + self.add_error("password", self.error_messages['empty_password']) raise forms.ValidationError( self.error_messages['incomplete'], code='incomplete'