forked from 42CTF/website
fixed missing team when event is not password protected
This commit is contained in:
parent
36ab01765e
commit
8a2dd4dc80
|
@ -67,11 +67,11 @@ def chall_event_info(request, event_slug, chall_slug):
|
||||||
'congrat': congrat, 'wrongflag': wrongflag, 'errorform': errorform, 'notsub': notsub})
|
'congrat': congrat, 'wrongflag': wrongflag, 'errorform': errorform, 'notsub': notsub})
|
||||||
|
|
||||||
def event(request, event_slug):
|
def event(request, event_slug):
|
||||||
event_info = get_object_or_404(Event, slug=event_slug)
|
event_info = get_object_or_404(Event, slug=event_slug)
|
||||||
IsRegistered = False
|
IsRegistered = False
|
||||||
wrongpwd = False
|
wrongpwd = False
|
||||||
alreadyregistered = False
|
alreadyregistered = False
|
||||||
subisover = False
|
subisover = False
|
||||||
if request.GET.get('WrongPassword'):
|
if request.GET.get('WrongPassword'):
|
||||||
wrongpwd = True
|
wrongpwd = True
|
||||||
if request.GET.get('AlreadyRegistered'):
|
if request.GET.get('AlreadyRegistered'):
|
||||||
|
@ -85,6 +85,8 @@ def event(request, event_slug):
|
||||||
player = None
|
player = None
|
||||||
if player:
|
if player:
|
||||||
IsRegistered = True
|
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 event_info.password:
|
||||||
if request.user.is_authenticated:
|
if request.user.is_authenticated:
|
||||||
if request.user.is_staff is False:
|
if request.user.is_staff is False:
|
||||||
|
|
Loading…
Reference in New Issue