diff --git a/app.py b/app.py index 827a2d5..5091bb8 100644 --- a/app.py +++ b/app.py @@ -251,6 +251,11 @@ def inject_time(): def inject_has_authorized_cookie(): return {'has_authorized_cookie': 'authorized' in request.cookies} +@app.context_processor +def inject_is_blocked(): + ip = request.access_route[0] + return {'is_blocked': is_ip_blocked(ip)} + @app.before_request def require_system_password(): diff --git a/templates/base.html b/templates/base.html index e3c9947..fa3693c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -18,7 +18,7 @@ 🛒 Lista Zakupów - {% if has_authorized_cookie %} + {% if has_authorized_cookie and not is_blocked %} {% if current_user.is_authenticated %}