From 5df206e630d1934365883ce353151e2f574c02fd Mon Sep 17 00:00:00 2001 From: luxcem Date: Sat, 22 Apr 2017 22:14:32 +0200 Subject: [PATCH] updates votes view --- .gitignore | 2 ++ apps/rp/views/votes.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e52e13e..faded75 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ .DS_Store ._* +.#* + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/apps/rp/views/votes.py b/apps/rp/views/votes.py index d6a17e9..9a0d329 100644 --- a/apps/rp/views/votes.py +++ b/apps/rp/views/votes.py @@ -27,12 +27,12 @@ class UDList(ListView): context = super().get_context_data(**kwargs) context["und_votes"] = { "upvoted": queryset.filter( - und_votes__user=self.request.user, + und_votes__username=self.request.user.username, und_votes__content_type=content_type, und_votes__score=1 ).values_list("id", flat=True), "downvoted": queryset.filter( - und_votes__user=self.request.user, + und_votes__username=self.request.user.username, und_votes__content_type=content_type, und_votes__score=-1 ).values_list("id", flat=True) -- GitLab