reg/views.py
changeset 32 00a016cf226e
parent 31 d0a2f881d4b5
child 33 6a68ef9597f9
equal deleted inserted replaced
31:d0a2f881d4b5 32:00a016cf226e
   269 
   269 
   270     user = request.user
   270     user = request.user
   271     try:
   271     try:
   272         event = Event.objects.get(key__iexact=event_key)
   272         event = Event.objects.get(key__iexact=event_key)
   273     except Event.DoesNotExist:
   273     except Event.DoesNotExist:
   274         return redirect("/reg")
   274         raise Http404
   275 
   275 
   276     is_org = True if user in event.organizers.all() and user.is_staff else False
   276     if user in event.organizers.all() and user.is_staff:
   277 
       
   278     if is_org:
       
   279         day = event.feedback_status
   277         day = event.feedback_status
   280         event.feedback_status = '0'
   278         event.feedback_status = '0'
   281         event.save()
   279         event.save()
   282         return render_to_response('close_feedback.html', {'user':user, 'event': event, 'day':day})
   280         return render_to_response('close_feedback.html', {'user':user, 'event': event, 'day':day})
   283     else:
   281     else:
   284         return redirect('/reg')
   282         raise Http404
   285 
   283 
   286 def open_registration(request, event_key):
   284 def open_registration(request, event_key):
   287     """ simply check for is_org and then set the registration_is_open flag.
   285     """ simply check for is_org and then set the registration_is_open flag.
   288     """
   286     """
   289 
   287