From a7a33ed1652e27b354ef330b0fa72cf398c0f076 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 20 Jun 2024 17:14:32 +0200 Subject: [PATCH] Voucher bulk form: Strip spaces from email addresses before validation --- src/pretix/control/forms/vouchers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pretix/control/forms/vouchers.py b/src/pretix/control/forms/vouchers.py index 3ea916c7e..e1ffa823b 100644 --- a/src/pretix/control/forms/vouchers.py +++ b/src/pretix/control/forms/vouchers.py @@ -366,9 +366,9 @@ class VoucherBulkForm(VoucherForm): raise ValidationError(_('CSV input contains an unknown field with the header "{header}".').format(header=unknown_fields[0])) for i, row in enumerate(reader): try: - EmailValidator()(row['email']) + EmailValidator()(row['email'].strip()) except ValidationError as err: - raise ValidationError(_('{value} is not a valid email address.').format(value=row['email'])) from err + raise ValidationError(_('{value} is not a valid email address.').format(value=row['email'].strip())) from err try: res.append(self.Recipient( name=row.get('name', ''),