2
0
Fork 0

hide registration if event is over

This commit is contained in:
Andreas (@xAndy) Zimmermann 2022-04-27 23:15:59 +02:00
parent cad8945e25
commit 06c3a39bde
1 changed files with 6 additions and 1 deletions

View File

@ -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"])