fix throttle bug
throttling was checked before other errors, meaning you got throttled without actually saving anything
This commit is contained in:
parent
248b3a512a
commit
4acf87733a
@ -39,9 +39,9 @@ class GuestbookForm(Form):
|
||||
def clean(self):
|
||||
result = super().clean()
|
||||
|
||||
throttle_submission(result['name'])
|
||||
|
||||
if self.errors:
|
||||
raise ValidationError('oops, looks like there were some problems below.')
|
||||
|
||||
throttle_submission(result['name'])
|
||||
|
||||
return result
|
||||
|
@ -51,9 +51,9 @@ class TicketForm(Form):
|
||||
def clean(self):
|
||||
result = super().clean()
|
||||
|
||||
throttle_submission(result['email'])
|
||||
|
||||
if self.errors:
|
||||
raise ValidationError('oops, looks like there were some problems below.')
|
||||
|
||||
throttle_submission(result['email'])
|
||||
|
||||
return result
|
||||
|
Loading…
x
Reference in New Issue
Block a user