feedback/views.py
changeset 36 cd0f61fa31f1
parent 35 79dc44b6edd4
child 38 b63b78017225
--- a/feedback/views.py	Tue Apr 13 15:15:13 2010 +0530
+++ b/feedback/views.py	Tue Apr 13 16:29:58 2010 +0530
@@ -51,5 +51,16 @@
     """ print a list of all the feedbacks collected.
     """
 
-    feeds = Feedback.objects.all()
+    user = request.user
+    
+    try:
+        event = Event.objects.get(key__iexact=event_key)
+    except Event.DoesNotExist:
+        raise Http404
+
+    if not user in event.organizers.all():
+        raise Http404
+
+    feeds = Feedback.objects.filter(event=event)
     return render_to_response('list_feedbacks.html',{'feeds':feeds})
+