summaryrefslogtreecommitdiffstats
path: root/forum
diff options
context:
space:
mode:
authorAdolfo Fitoria <fitoria@fitoria-laptop.(none)>2009-08-08 22:54:56 -0600
committerAdolfo Fitoria <fitoria@fitoria-laptop.(none)>2009-08-08 22:54:56 -0600
commitcedac7935f10258230b4e5de7eb63dd098b87c3b (patch)
tree8b7be0a8adc2ee5cd58eb72fb7c641c0dfe3f9b7 /forum
parentfed254aac68551d612f1ce0ab0e6d6a55f8b7c5a (diff)
downloadaskbot-cedac7935f10258230b4e5de7eb63dd098b87c3b.tar.gz
askbot-cedac7935f10258230b4e5de7eb63dd098b87c3b.tar.bz2
askbot-cedac7935f10258230b4e5de7eb63dd098b87c3b.zip
fixing a bug in question view
Diffstat (limited to 'forum')
-rw-r--r--forum/views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/forum/views.py b/forum/views.py
index 6ef7bd6d..1566e9a8 100644
--- a/forum/views.py
+++ b/forum/views.py
@@ -332,7 +332,10 @@ def question(request, id):
answers = answers.select_related(depth=1)
favorited = question.has_favorite_by_user(request.user)
- question_vote = question.votes.select_related().filter(user=request.user)
+ if not request.user.is_anonymous():
+ question_vote = question.votes.select_related().filter(user=request.user)
+ else:
+ question_vote = None #is this correct?
if question_vote is not None and question_vote.count() > 0:
question_vote = question_vote[0]