Strip whitespace from voucher codes

This commit is contained in:
Raphael Michel
2016-09-09 14:15:16 +02:00
parent 15b9d8420c
commit 9b67d8d363
2 changed files with 2 additions and 2 deletions

View File

@@ -109,7 +109,7 @@ def _add_new_items(event: Event, items: List[dict],
voucher = None
if i.get('voucher'):
try:
voucher = Voucher.objects.get(code=i.get('voucher'), event=event)
voucher = Voucher.objects.get(code=i.get('voucher').strip(), event=event)
if voucher.redeemed:
return error_messages['voucher_redeemed']
if voucher.valid_until is not None and voucher.valid_until < now_dt: