summaryrefslogtreecommitdiffstats
path: root/askbot/views/users.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-10-15 03:06:01 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-10-15 03:06:01 -0300
commit6b0130e391d87723731ab0ebfbfed0fe03bc63fc (patch)
treeea10161a097910cdae7956f3ee11a9bfb8f066dc /askbot/views/users.py
parent3c6a182685ad217129271dfd77280b3710242777 (diff)
downloadaskbot-6b0130e391d87723731ab0ebfbfed0fe03bc63fc.tar.gz
askbot-6b0130e391d87723731ab0ebfbfed0fe03bc63fc.tar.bz2
askbot-6b0130e391d87723731ab0ebfbfed0fe03bc63fc.zip
added test cases and fixed some issues related to posting of private questions and answers
Diffstat (limited to 'askbot/views/users.py')
-rw-r--r--askbot/views/users.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/askbot/views/users.py b/askbot/views/users.py
index 707f4e14..c22fd294 100644
--- a/askbot/views/users.py
+++ b/askbot/views/users.py
@@ -371,9 +371,15 @@ def user_stats(request, user, context):
#
# Questions
#
- questions = user.posts.get_questions().filter(**question_filter).\
- order_by('-points', '-thread__last_activity_at').\
- select_related('thread', 'thread__last_activity_by')[:100]
+ questions = user.posts.get_questions(
+ user=request.user
+ ).filter(
+ **question_filter
+ ).order_by(
+ '-points', '-thread__last_activity_at'
+ ).select_related(
+ 'thread', 'thread__last_activity_by'
+ )[:100]
#added this if to avoid another query if questions is less than 100
if len(questions) < 100: