]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/users.py
Added a direct option to mark a post as community wiki, still needs some sort of...
[osqa.git] / forum / views / users.py
index 67f0a90c257aa2557a3cf4f970dbc94f24c6fb55..7202d39e7fbd2f2a5b1e8f758048972dd6572b72 100644 (file)
@@ -174,8 +174,8 @@ def user_view(template, tab_name, tab_description, page_title, private=False):
 \r
 @user_view('users/stats.html', 'stats', _('user profile'), _('user overview'))\r
 def user_stats(request, user):\r
-    questions = Question.objects.filter(author=user, deleted=None).order_by('-added_at')\r
-    answers = Answer.objects.filter(author=user, deleted=None).order_by('-added_at')\r
+    questions = Question.objects.filter_state(deleted=False).filter(author=user).order_by('-added_at')\r
+    answers = Answer.objects.filter_state(deleted=False).filter(author=user).order_by('-added_at')\r
 \r
     up_votes = user.vote_up_count\r
     down_votes = user.vote_down_count\r
@@ -211,7 +211,7 @@ def user_recent(request, user):
 \r
 @user_view('users/votes.html', 'votes', _('user vote record'), _('votes'), True)\r
 def user_votes(request, user):\r
-    votes = user.votes.filter(node__deleted=None, node__node_type__in=("question", "answer")).order_by('-voted_at')[:USERS_PAGE_SIZE]\r
+    votes = user.votes.exclude(node__state_string__contains="(deleted").filter(node__node_type__in=("question", "answer")).order_by('-voted_at')[:USERS_PAGE_SIZE]\r
 \r
     return {"view_user" : user, "votes" : votes}\r
 \r