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
luxcem
memopol
Commits
6ca37d12
Commit
6ca37d12
authored
Feb 17, 2017
by
okhin
Browse files
Let's urlunqoute the filter
parent
9c200545
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/representatives/filters.py
View file @
6ca37d12
...
...
@@ -4,6 +4,7 @@ from datetime import datetime
from
rest_framework.filters
import
BaseFilterBackend
from
django.db.models
import
Q
from
django.conf
import
settings
from
django.utils.http
import
urlunquote
from
.models
import
Mandate
...
...
@@ -49,7 +50,7 @@ class ActiveConstituencyFilterBackend(BaseFilterBackend):
if
self
.
query_param
in
request
.
GET
:
if
len
(
request
.
GET
[
self
.
query_params
]):
mandates
=
request
.
GET
[
self
.
query_param
].
split
(
','
)
mandates
=
urlunqoute
(
request
.
GET
[
self
.
query_param
]
)
.
split
(
','
)
qs
=
qs
.
filter
(
mandates__in
=
Mandate
.
objects
.
filter
(
Q
(
end_date__gte
=
datetime
.
today
)
|
Q
(
end_date__isnull
=
True
)).
filter
(
...
...
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