reg/views.py
changeset 37 981c3eb98e0e
parent 33 6a68ef9597f9
child 43 757d1da69255
--- a/reg/views.py	Tue Apr 13 16:29:58 2010 +0530
+++ b/reg/views.py	Tue Apr 13 16:32:13 2010 +0530
@@ -248,15 +248,14 @@
         raise Http404
 
     if user in event.organizers.all() and user.is_staff and event.feedback_status == '0':
-        #days = event.stop_date.day() - event.start_date.day() + 1
-        days = 2
+        no_of_days = (event.stop_date - event.start_date).days + 1
         if request.method == "POST":
             day = request.POST['day']
             event.feedback_status = day
             event.save()
             return render_to_response('open_feedback.html', {'user':user, 'success': True, 'day':day, 'event':event})
         else:
-            return render_to_response('open_feedback.html', {'user':user, 'event': event, 'days': range(1,days+1)})
+            return render_to_response('open_feedback.html', {'user':user, 'event': event, 'days': range(1,no_of_days+1)})
     else:
         raise Http404