From 06c3a39bde2ee515490f2f7b1c91dd491cb05fd4 Mon Sep 17 00:00:00 2001 From: "Andreas (@xAndy) Zimmermann" Date: Wed, 27 Apr 2022 23:15:59 +0200 Subject: [PATCH] hide registration if event is over --- shiftregister/app/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shiftregister/app/views.py b/shiftregister/app/views.py index ec9415d..ffb5af8 100644 --- a/shiftregister/app/views.py +++ b/shiftregister/app/views.py @@ -9,6 +9,9 @@ from django.conf import settings from django.contrib import messages import datetime from .decorators import event_state +from dynamic_preferences.registries import global_preferences_registry + +global_preferences = global_preferences_registry.manager() @event_state @@ -86,7 +89,9 @@ def logout(request): def register(request): - # handle number already being registered(resend message?) + if global_preferences["helper__event_state"] == "AFTER": + return render(request, "event_after.html", {}) + if request.helper: if request.session.get("last_seen_shift"): return redirect("shift", shiftid=request.session["last_seen_shift"])