1
0

Fix None access when header not present

This commit is contained in:
Marcel Schwarz 2023-07-24 20:43:56 +02:00
parent 075a7426bf
commit e2b980f899

View File

@ -68,7 +68,7 @@ def voting(request: HttpRequest) -> django.http.HttpResponse:
return HttpResponseRedirect(reverse("events"))
# 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}"
rate_cache: django.core.cache.BaseCache = cache
if ip not in rate_cache: