reg/views.py
changeset 31 d0a2f881d4b5
parent 30 b85cb9cc9010
child 32 00a016cf226e
equal deleted inserted replaced
30:b85cb9cc9010 31:d0a2f881d4b5
   291     try:
   291     try:
   292         event = Event.objects.get(key__iexact=event_key)
   292         event = Event.objects.get(key__iexact=event_key)
   293     except Event.DoesNotExist:
   293     except Event.DoesNotExist:
   294         return redirect("/reg")
   294         return redirect("/reg")
   295 
   295 
   296     is_org = True if user in event.organizers.all() and user.is_staff else False
   296     if user in event.organizers.all() and user.is_staff:
   297 
       
   298     if is_org:
       
   299         event.registration_is_open = True
   297         event.registration_is_open = True
   300         event.save()
   298         event.save()
   301         return render_to_response('reg_open.html', {'user':user, 'event': event})
   299         return render_to_response('reg_open.html', {'user':user, 'event': event})
   302     else:
   300     else:
   303         return redirect('/reg')
   301         raise Http404
   304 
   302 
   305 def close_registration(request, event_key):
   303 def close_registration(request, event_key):
   306     """ simply check for is_org and then unset the registration_is_open flag.
   304     """ simply check for is_org and then unset the registration_is_open flag.
   307     """
   305     """
   308 
   306