subDesTagesMitExtraKaese 2 years ago
parent
commit
42bb88f7cb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      zitap/views.py

+ 1 - 1
zitap/views.py

@@ -50,7 +50,7 @@ def event(request, url):
     
     # Check if the user is logged in
     if 'user_id' in request.session:
-        participant = Participant.objects.get(user_id=request.session['user_id'], event=event)
+        participant, created = Participant.objects.get_or_create(user_id=request.session['user_id'], event=event)
         login_form = None
         update_form = UpdateSlotsForm(initial={'slots': slots2string(participant, get_slot_count(event))}, participant=participant)
     else: