Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
rpteam
Revue de Press
Commits
5df206e6
Commit
5df206e6
authored
Apr 22, 2017
by
luxcem
Browse files
updates votes view
parent
f2c81e44
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
5df206e6
...
...
@@ -2,6 +2,8 @@
.DS_Store
._*
.#*
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
...
...
apps/rp/views/votes.py
View file @
5df206e6
...
...
@@ -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__user
name
=
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__user
name
=
self
.
request
.
user
.
username
,
und_votes__content_type
=
content_type
,
und_votes__score
=-
1
).
values_list
(
"id"
,
flat
=
True
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment