Skip to content

Commit

Permalink
fix spam validation on bad signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Akasch committed Dec 8, 2019
1 parent c2222d4 commit d387ed5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bitpoll/poll/spam_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def check_anti_spam_challange(key: str, answer: str, poll_id: int) -> bool:
if spam_data.get('type') != 'anti_spam':
raise ValidationError(_("Error while checking response"))
except BadSignature:
raise ValueError(_("Error while checking response"))
raise ValidationError(_("Error while checking response"))
if spam_data['poll_id'] != poll_id:
raise ValidationError(_("Error while checking response"))
if spam_data['time'] <= time.time() - django_settings.ANTI_SPAM_CHALLENGE_TTL:
Expand Down

0 comments on commit d387ed5

Please sign in to comment.