diff options
author | Adolfo Fitoria <fitoria@fitoria-laptop.(none)> | 2009-08-08 22:54:32 -0600 |
---|---|---|
committer | Adolfo Fitoria <fitoria@fitoria-laptop.(none)> | 2009-08-08 22:54:32 -0600 |
commit | 5da7bf344a7279b1a2ed820a99dd4858f45837f5 (patch) | |
tree | 8b7be0a8adc2ee5cd58eb72fb7c641c0dfe3f9b7 /forum | |
parent | ef316e9d07932630be286d1a67b41de673d7b7d9 (diff) | |
download | askbot-5da7bf344a7279b1a2ed820a99dd4858f45837f5.tar.gz askbot-5da7bf344a7279b1a2ed820a99dd4858f45837f5.tar.bz2 askbot-5da7bf344a7279b1a2ed820a99dd4858f45837f5.zip |
fixing a bug in question view
Diffstat (limited to 'forum')
-rw-r--r-- | forum/views.py | 5 |
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] |