Polls: show only open polls
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 20 May 2013 13:29:27 +0000 (15:29 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 3 Jun 2013 08:03:41 +0000 (10:03 +0200)
apps/polls/views.py

index ac1c360..c9cb5de 100644 (file)
@@ -10,7 +10,7 @@ from forms import PollForm
 @require_http_methods(['GET', 'POST'])\r
 def poll(request, slug):
     
-    poll = get_object_or_404(Poll, slug = slug)
+    poll = get_object_or_404(Poll, slug = slug, open = True)
     
     if request.method == 'POST':\r
         redirect_to = reverse('poll', args = [slug])