Make voucher lookups case-insensitive

This commit is contained in:
Raphael Michel
2018-03-16 15:24:05 +01:00
parent b564fe8a0d
commit 5e3b4b126e
5 changed files with 12 additions and 10 deletions

View File

@@ -295,7 +295,7 @@ class CartManager:
if i.get('voucher'):
try:
voucher = self.event.vouchers.get(code=i.get('voucher').strip())
voucher = self.event.vouchers.get(code__iexact=i.get('voucher').strip())
except Voucher.DoesNotExist:
raise CartError(error_messages['voucher_invalid'])
else: