Bulk voucher creation: Fix spaces in seat IDs

This commit is contained in:
Raphael Michel
2019-11-15 18:38:55 +01:00
parent a0dd495cc3
commit 9515249098

View File

@@ -351,8 +351,7 @@ class VoucherBulkForm(VoucherForm):
raise ValidationError(_('You generated {codes} vouchers, but entered recipients for {recp} vouchers.').format(codes=code_len, recp=recp_len))
if data.get('seats'):
seatids = [s.strip() for s in data.get('seats').strip().split() if s]
print(seatids)
seatids = [s.strip() for s in data.get('seats').strip().split("\n") if s]
if len(seatids) != len(data.get('codes')):
raise ValidationError(_('You need to specify as many seats as voucher codes.'))
data['seats'] = []