From 1c40351b2793b09e3fb32679f7ae74b734138fd2 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sun, 17 Nov 2019 19:31:21 +0100 Subject: [PATCH] Bulk voucher sending: Correctly strip lines of whitespace --- 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 8a9f6dc982..56437d6bc9 100644 --- a/src/pretix/control/forms/vouchers.py +++ b/src/pretix/control/forms/vouchers.py @@ -315,7 +315,7 @@ class VoucherBulkForm(VoucherForm): try: res.append(self.Recipient( name=row.get('name', ''), - email=row['email'], + email=row['email'].strip(), number=int(row.get('number', 1)), tag=row.get('tag', None) )) @@ -328,7 +328,7 @@ class VoucherBulkForm(VoucherForm): except ValidationError as err: raise ValidationError(_('{value} is not a valid email address.').format(value=e.strip())) from err else: - res.append(self.Recipient(email=e, number=1, tag=None, name='')) + res.append(self.Recipient(email=e.stripe(), number=1, tag=None, name='')) return res def clean(self):