Fix KeyError during form validation

This commit is contained in:
Raphael Michel
2019-04-25 10:36:29 +02:00
parent 8e56c8dcf7
commit 13bf975dd5

View File

@@ -140,7 +140,7 @@ class VoucherForm(I18nModelForm):
data['codes'] = [a.strip() for a in data.get('codes', '').strip().split("\n") if a]
cnt = len(data['codes']) * data.get('max_usages', 0)
else:
cnt = data['max_usages']
cnt = data.get('max_usages', 0)
Voucher.clean_item_properties(
data, self.instance.event,