Skip to content

Commit

Permalink
Merge branch 'master' into fix_2fa
Browse files Browse the repository at this point in the history
  • Loading branch information
KamilPawel authored and KamilPawel committed Sep 19, 2023
2 parents f8a140d + ed17db7 commit 1de6a31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion portal/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "6.36.0"
__version__ = "6.36.1"
11 changes: 10 additions & 1 deletion portal/helpers/ratelimit.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,16 @@ def get_usage(request, group=None, fn=None, key=None, rate=None, method=ALL, inc

cache_name = getattr(settings, "RATELIMIT_USE_CACHE", "default")
cache = caches[cache_name]
cache_key = _make_cache_key(group, window, rate, value, method)

if value == "":
return {
"count": 0,
"limit": 0,
"should_limit": False,
"time_left": -1,
}
else:
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 1de6a31

Please sign in to comment.