forked from CGM_Public/pretix_original
Bulk voucher creation: Fix spaces in seat IDs
This commit is contained in:
@@ -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))
|
raise ValidationError(_('You generated {codes} vouchers, but entered recipients for {recp} vouchers.').format(codes=code_len, recp=recp_len))
|
||||||
|
|
||||||
if data.get('seats'):
|
if data.get('seats'):
|
||||||
seatids = [s.strip() for s in data.get('seats').strip().split() if s]
|
seatids = [s.strip() for s in data.get('seats').strip().split("\n") if s]
|
||||||
print(seatids)
|
|
||||||
if len(seatids) != len(data.get('codes')):
|
if len(seatids) != len(data.get('codes')):
|
||||||
raise ValidationError(_('You need to specify as many seats as voucher codes.'))
|
raise ValidationError(_('You need to specify as many seats as voucher codes.'))
|
||||||
data['seats'] = []
|
data['seats'] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user