mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Vouchers: fix code min-length check on bulk creation
This commit is contained in:
committed by
GitHub
parent
ca23073760
commit
ca79436e36
@@ -395,6 +395,15 @@ class VoucherBulkForm(VoucherForm):
|
||||
|
||||
codes_seen = set()
|
||||
for c in data['codes']:
|
||||
if len(c) < 5:
|
||||
raise ValidationError({
|
||||
'codes': [
|
||||
_('The voucher code {code} ist too short. Make sure all voucher codes are at least {min_length} characters long.').format(
|
||||
code=c,
|
||||
min_length=5
|
||||
)
|
||||
]
|
||||
})
|
||||
if c in codes_seen:
|
||||
raise ValidationError(_('The voucher code {code} appears in your list twice.').format(code=c))
|
||||
codes_seen.add(c)
|
||||
|
||||
Reference in New Issue
Block a user