summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-03-08 17:30:37 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-03-08 17:30:37 -0300
commitda2842d7703e6ef82dbcedaaa96de3e53a01695f (patch)
tree20596ee381a8575f1ef1a503c5c0ad05314ef304
parent36dc72975136a9a99aa7eca677666048eaa12029 (diff)
downloadaskbot-da2842d7703e6ef82dbcedaaa96de3e53a01695f.tar.gz
askbot-da2842d7703e6ef82dbcedaaa96de3e53a01695f.tar.bz2
askbot-da2842d7703e6ef82dbcedaaa96de3e53a01695f.zip
corrected check for anonymous user in the visit question task
-rw-r--r--askbot/tasks.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/askbot/tasks.py b/askbot/tasks.py
index 0ae96c09..5df24a4c 100644
--- a/askbot/tasks.py
+++ b/askbot/tasks.py
@@ -152,11 +152,12 @@ def record_question_visit(
if update_view_count:
question_post.thread.increase_view_count()
- user = User.objects.get(id=user_id)
-
- if user.is_anonymous():
+ #we do not track visits per anon user
+ if user_id is None:
return
+ user = User.objects.get(id=user_id)
+
#2) question view count per user and clear response displays
#user = User.objects.get(id = user_id)
if user.is_authenticated():