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 %}
Zalogowany: @@ -34,7 +34,7 @@
- {% if request.endpoint != 'system_auth' %} + {% if request.endpoint and request.endpoint != 'system_auth' %} {% if current_user.is_authenticated and current_user.is_admin %} ⚙️ Panel admina {% endif %} diff --git a/templates/errors.html b/templates/errors.html index 4ce0df2..b3c5c0f 100644 --- a/templates/errors.html +++ b/templates/errors.html @@ -4,7 +4,6 @@

{{ code }} — {{ title }}

- ← Powrót na stronę główną