Commit 5df206e6 authored by luxcem's avatar luxcem
Browse files

updates votes view

parent f2c81e44
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
.DS_Store .DS_Store
._* ._*
.#*
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/
*.py[cod] *.py[cod]
......
...@@ -27,12 +27,12 @@ class UDList(ListView): ...@@ -27,12 +27,12 @@ class UDList(ListView):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
context["und_votes"] = { context["und_votes"] = {
"upvoted": queryset.filter( "upvoted": queryset.filter(
und_votes__user=self.request.user, und_votes__username=self.request.user.username,
und_votes__content_type=content_type, und_votes__content_type=content_type,
und_votes__score=1 und_votes__score=1
).values_list("id", flat=True), ).values_list("id", flat=True),
"downvoted": queryset.filter( "downvoted": queryset.filter(
und_votes__user=self.request.user, und_votes__username=self.request.user.username,
und_votes__content_type=content_type, und_votes__content_type=content_type,
und_votes__score=-1 und_votes__score=-1
).values_list("id", flat=True) ).values_list("id", flat=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment