mirror of
https://github.com/pretix/pretix.git
synced 2026-09-30 19:04:43 +00:00
Fix voucher batch-import handling missing email column in row
This commit is contained in:
@@ -615,9 +615,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'].strip())
|
||||
EmailValidator()(row.get('email', '').strip())
|
||||
except ValidationError as err:
|
||||
raise ValidationError(_('{value} is not a valid email address.').format(value=row['email'].strip())) from err
|
||||
raise ValidationError(_('{value} in line {line} is not a valid email address.').format(line=i, value=row.get('email', '').strip())) from err
|
||||
try:
|
||||
res.append(self.Recipient(
|
||||
name=row.get('name', ''),
|
||||
|
||||
Reference in New Issue
Block a user