Skip to content
Snippets Groups Projects
Commit ae23d9e6 authored by Zdenek Kubala's avatar Zdenek Kubala
Browse files

signup to sifrovacka set 1 stage urlhash as well

parent f5a087d8
Branches
No related tags found
1 merge request!2Added stage web page
...@@ -145,11 +145,19 @@ def home(request): ...@@ -145,11 +145,19 @@ def home(request):
request.user).order_by('sifrovacka_id') request.user).order_by('sifrovacka_id')
if request.method == 'POST': if request.method == 'POST':
if request.POST["signupsif"]: if request.POST["signupsif"]:
post_signupsif = request.POST["signupsif"] post_signupsif = request.POST["signupsif"]
print(post_signupsif) print(post_signupsif)
sifrovacka_detail = Sifrovacka.objects.get(id = post_signupsif)
sifrovacka_stages = Stages.objects.filter(sifrovacka__sifrovacka_name =
sifrovacka_detail).filter(stage_number = "1")
stage_current_urlhash = sifrovacka_stages[0].stage_urlhash
print(stage_current_urlhash)
try: try:
p = Participants.objects.create(user=request.user, p = Participants.objects.create(user=request.user,
sifrovacka_id=post_signupsif) sifrovacka_id=post_signupsif,
at_stage=stage_current_urlhash )
except IntegrityError as e: except IntegrityError as e:
print(e) print(e)
context = {"active_sifrovacky_list": all_sifrovacky_list, context = {"active_sifrovacky_list": all_sifrovacky_list,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment