Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jelle van der Waa
Archweb
Commits
577a1c3a
Commit
577a1c3a
authored
Jul 07, 2018
by
Jelle van der Waa
🚧
Browse files
Revert "Fix parsing issues when query string keys contain unicode"
This reverts commit
bb18fa33
.
parent
2480e9d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
packages/templatetags/package_extras.py
View file @
577a1c3a
...
...
@@ -14,12 +14,6 @@ def __init__(self, sortfield):
def
render
(
self
,
context
):
qs
=
parse_qs
(
context
[
'current_query'
])
# This is really dirty. The crazy round trips we do on our query string
# mean we get things like u'\xe2\x98\x83' in our views, when we should
# have simply u'\u2603' or a byte string of the UTF-8 value. Force the
# keys and list of values to be byte strings only.
qs
=
{
k
.
encode
(
'latin-1'
):
[
v
.
encode
(
'latin-1'
)
for
v
in
vals
]
for
k
,
vals
in
list
(
qs
.
items
())}
if
'sort'
in
qs
and
self
.
sortfield
in
qs
[
'sort'
]:
if
self
.
sortfield
.
startswith
(
'-'
):
qs
[
'sort'
]
=
[
self
.
sortfield
[
1
:]]
...
...
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