From 8a2dd4dc804acc34d30c7653b8ee133a86b9e2d1 Mon Sep 17 00:00:00 2001 From: Danhia Date: Sun, 2 Jan 2022 21:00:02 +0100 Subject: [PATCH] fixed missing team when event is not password protected --- src/events/views.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/events/views.py b/src/events/views.py index 6bb7128..e064a8b 100644 --- a/src/events/views.py +++ b/src/events/views.py @@ -67,11 +67,11 @@ def chall_event_info(request, event_slug, chall_slug): 'congrat': congrat, 'wrongflag': wrongflag, 'errorform': errorform, 'notsub': notsub}) def event(request, event_slug): - event_info = get_object_or_404(Event, slug=event_slug) - IsRegistered = False - wrongpwd = False - alreadyregistered = False - subisover = False + event_info = get_object_or_404(Event, slug=event_slug) + IsRegistered = False + wrongpwd = False + alreadyregistered = False + subisover = False if request.GET.get('WrongPassword'): wrongpwd = True if request.GET.get('AlreadyRegistered'): @@ -85,6 +85,8 @@ def event(request, event_slug): player = None if player: IsRegistered = True + if not player.team and event_info.team_size > 1: + return render(request, 'events/create_team.html', {'event' : event_info, 'logged': True, 'wrongpwd': False, 'registered' : True, 'notexist' : False}) if event_info.password: if request.user.is_authenticated: if request.user.is_staff is False: