feedback/views.py
changeset 36 cd0f61fa31f1
parent 35 79dc44b6edd4
child 38 b63b78017225
equal deleted inserted replaced
35:79dc44b6edd4 36:cd0f61fa31f1
    49 
    49 
    50 def list_feedbacks(request, event_key):
    50 def list_feedbacks(request, event_key):
    51     """ print a list of all the feedbacks collected.
    51     """ print a list of all the feedbacks collected.
    52     """
    52     """
    53 
    53 
    54     feeds = Feedback.objects.all()
    54     user = request.user
       
    55     
       
    56     try:
       
    57         event = Event.objects.get(key__iexact=event_key)
       
    58     except Event.DoesNotExist:
       
    59         raise Http404
       
    60 
       
    61     if not user in event.organizers.all():
       
    62         raise Http404
       
    63 
       
    64     feeds = Feedback.objects.filter(event=event)
    55     return render_to_response('list_feedbacks.html',{'feeds':feeds})
    65     return render_to_response('list_feedbacks.html',{'feeds':feeds})
       
    66