forked from CGM_Public/pretix_original
Bulk voucher sending: Correctly strip lines of whitespace
This commit is contained in:
@@ -315,7 +315,7 @@ class VoucherBulkForm(VoucherForm):
|
|||||||
try:
|
try:
|
||||||
res.append(self.Recipient(
|
res.append(self.Recipient(
|
||||||
name=row.get('name', ''),
|
name=row.get('name', ''),
|
||||||
email=row['email'],
|
email=row['email'].strip(),
|
||||||
number=int(row.get('number', 1)),
|
number=int(row.get('number', 1)),
|
||||||
tag=row.get('tag', None)
|
tag=row.get('tag', None)
|
||||||
))
|
))
|
||||||
@@ -328,7 +328,7 @@ class VoucherBulkForm(VoucherForm):
|
|||||||
except ValidationError as err:
|
except ValidationError as err:
|
||||||
raise ValidationError(_('{value} is not a valid email address.').format(value=e.strip())) from err
|
raise ValidationError(_('{value} is not a valid email address.').format(value=e.strip())) from err
|
||||||
else:
|
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
|
return res
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user