Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Political Memory
memopol
Commits
df509e12
Commit
df509e12
authored
Jan 12, 2017
by
okhin
Browse files
I want to check name or abbreviation of group mandates
parent
5fc2da48
Pipeline
#744
failed with stage
in 8 minutes and 47 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/representatives/filters.py
View file @
df509e12
...
...
@@ -23,6 +23,8 @@ class ActiveMandateQueryFilterBackend(BaseFilterBackend):
if
len
(
request
.
GET
[
self
.
query_param
]):
qs
=
qs
.
filter
(
mandates__in
=
Mandate
.
objects
.
filter
(
Q
(
end_date__gte
=
datetime
.
today
)
|
Q
(
end_date__isnull
=
True
))
.
filter
(
Q
(
group__name
=
request
.
GET
[
self
.
query_param
]))).
distinct
()
.
filter
(
Q
(
group__name
=
request
.
GET
[
self
.
query_param
])
|
Q
(
group__abbreviation
=
request
.
GET
[
self
.
query_param
])))
.
distinct
()
return
qs
return
qs
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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