fix throttle bug

throttling was checked before other errors, meaning you got throttled
without actually saving anything
pull/1/head
nathaniel smith 2016-12-19 22:52:17 -08:00
parent 248b3a512a
commit 4acf87733a
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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