Skip to content

Commit

Permalink
fix allow users to reset their password
Browse files Browse the repository at this point in the history
  • Loading branch information
KamilPawel authored and KamilPawel committed Sep 18, 2023
1 parent a0c5e59 commit 02fd10e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions portal/helpers/ratelimit.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ def get_usage(request, group=None, fn=None, key=None, rate=None, method=ALL, inc
else:
raise ImproperlyConfigured("Could not understand ratelimit key: %s" % key)

window = _get_window(value, period)
window = _get_window(value=value or request.session["auth-username"], period=period)
initial_value = 1 if increment else 0

cache_name = getattr(settings, "RATELIMIT_USE_CACHE", "default")
cache = caches[cache_name]
cache_key = _make_cache_key(group, window, rate, value or request.session.get("auth-username", ""), method)
cache_key = _make_cache_key(group, window, rate, value, method)

count = None
added = cache.add(cache_key, initial_value, period + EXPIRATION_FUDGE)
Expand Down

0 comments on commit 02fd10e

Please sign in to comment.