From e134aa70093e157358c7dc8fffb3ab16f2112e28 Mon Sep 17 00:00:00 2001 From: Luca Date: Sat, 6 May 2023 17:44:14 +0200 Subject: [PATCH] Add option to enable/disable asking users for AStA membership confirmation --- shiftregister/app/dynamic_preferences_registry.py | 6 ++++++ shiftregister/app/templates/helper_base.html | 2 +- shiftregister/app/views.py | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/shiftregister/app/dynamic_preferences_registry.py b/shiftregister/app/dynamic_preferences_registry.py index 59b08f9..9e80d5e 100644 --- a/shiftregister/app/dynamic_preferences_registry.py +++ b/shiftregister/app/dynamic_preferences_registry.py @@ -63,3 +63,9 @@ class EnableRegistration(types.BooleanPreference): section = helper name = "enable_registration" default = True + +@global_preferences_registry.register +class EnableAsta(types.BooleanPreference): + section = helper + name = "enable_asta" + default = True diff --git a/shiftregister/app/templates/helper_base.html b/shiftregister/app/templates/helper_base.html index f5658e2..3698c66 100644 --- a/shiftregister/app/templates/helper_base.html +++ b/shiftregister/app/templates/helper_base.html @@ -5,7 +5,7 @@ {% block body %}
-{% if helper and not helper.asta_confirmed %} +{% if helper and not helper.asta_confirmed and enable_asta %} diff --git a/shiftregister/app/views.py b/shiftregister/app/views.py index b99bf20..1f3cc50 100644 --- a/shiftregister/app/views.py +++ b/shiftregister/app/views.py @@ -23,6 +23,7 @@ def index(request): context = { "days": Shift.objects.datetimes("start_at", "day"), + "enable_asta": global_preferences["helper__enable_asta"], } if request.helper: