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