Voucher creation: Fix crash in validation (PRETIXEU-8GF)

This commit is contained in:
Raphael Michel
2023-06-02 15:52:25 +02:00
parent eb3eca45b5
commit 35d2a73f75

View File

@@ -386,6 +386,7 @@ class VoucherBulkForm(VoucherForm):
def clean(self): def clean(self):
data = super().clean() data = super().clean()
if 'codes' in data:
vouchers = self.instance.event.vouchers.annotate( vouchers = self.instance.event.vouchers.annotate(
code_upper=Upper('code') code_upper=Upper('code')
).filter(code_upper__in=[c.upper() for c in data['codes']]) ).filter(code_upper__in=[c.upper() for c in data['codes']])