[Oi-commits] r1487 - trunk/forum

oi-commits at pardus.org.tr oi-commits at pardus.org.tr
Wed Jun 18 16:15:45 EEST 2008


Author: jnmbk
Date: Wed Jun 18 16:15:45 2008
New Revision: 1487

Modified:
   trunk/forum/views.py
Log:
fix

Modified: trunk/forum/views.py
=================================================================
--- trunk/forum/views.py	(original)
+++ trunk/forum/views.py	Wed Jun 18 16:15:45 2008
@@ -173,13 +173,15 @@
 
     # polloptions if topic has a poll
     poll_options = None
-    if topic.poll != None:
+    try:
         poll_options = topic.poll.polloption_set.all()
         total_vote_count = topic.poll.pollvote_set.count() * 1.0
         for option in poll_options:
             option.percent = int(option.vote_count / total_vote_count * 100)
             if option.percent < 80:
                 option.percent_out = True
+    except: #DoesNotExist
+        pass
 
     return object_list(request, posts,
                        template_name = 'forum/topic.html',


More information about the Oi-commits mailing list