Error message in the form when the voucher is invalid
This commit is contained in:
parent
28d09c968a
commit
8f9e1b5877
@ -19,6 +19,7 @@ class ExplorerCreationForm(UserCreationForm):
|
||||
try:
|
||||
fetched_voucher = Voucher.objects.get(code=sumitted_voucher)
|
||||
except Voucher.DoesNotExist:
|
||||
self.add_error('voucher', 'Invalid voucher')
|
||||
return False
|
||||
|
||||
fetched_voucher.delete()
|
||||
|
Loading…
Reference in New Issue
Block a user