Fix None access when header not present
This commit is contained in:
parent
075a7426bf
commit
e2b980f899
@ -68,7 +68,7 @@ def voting(request: HttpRequest) -> django.http.HttpResponse:
|
|||||||
return HttpResponseRedirect(reverse("events"))
|
return HttpResponseRedirect(reverse("events"))
|
||||||
|
|
||||||
# Check rate limit
|
# Check rate limit
|
||||||
ip = request.META["HTTP_X_REAL_IP"]
|
ip = request.META.get("HTTP_X_REAL_IP") or ""
|
||||||
cache_key = f"voting_block_{ip}"
|
cache_key = f"voting_block_{ip}"
|
||||||
rate_cache: django.core.cache.BaseCache = cache
|
rate_cache: django.core.cache.BaseCache = cache
|
||||||
if ip not in rate_cache:
|
if ip not in rate_cache:
|
||||||
|
Loading…
Reference in New Issue
Block a user