Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
VOneTimePassword: Change name to otp_ratelimit to avoid UnboundLocalE…
Browse files Browse the repository at this point in the history
…rror
  • Loading branch information
bsimpson63 committed Jun 15, 2016
1 parent 0d74afb commit 777c655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions r2/r2/lib/validator/validator.py
Expand Up @@ -2853,12 +2853,12 @@ def run(self, password):
# make sure they're not trying this too much
if not g.disable_ratelimit:
current_password = totp.make_totp(secret)
ratelimit = ratelimit.SimpleRateLimit(
otp_ratelimit = ratelimit.SimpleRateLimit(
name="otp_tries_%s_%s" % (c.user._id36, current_password),
seconds=600,
limit=self.ratelimit,
)
if not ratelimit.record_and_check():
if not otp_ratelimit.record_and_check():
self.set_error(errors.RATELIMIT, dict(time="30 seconds"))
return

Expand Down

0 comments on commit 777c655

Please sign in to comment.