diff --git a/django_lostplaces/lostplaces/forms.py b/django_lostplaces/lostplaces/forms.py index 86f291c..17e51cc 100644 --- a/django_lostplaces/lostplaces/forms.py +++ b/django_lostplaces/lostplaces/forms.py @@ -26,6 +26,10 @@ class ExplorerCreationForm(UserCreationForm): self.add_error('voucher', 'Invalid voucher') return False + if not submitted_voucher.valid: + self.add_error('voucher', 'Expired voucher') + return False + fetched_voucher.delete() return True