diff options
author | Ben Sturmfels <ben@sturm.com.au> | 2020-04-09 15:29:51 +1000 |
---|---|---|
committer | Ben Sturmfels <ben@sturm.com.au> | 2020-04-09 15:29:51 +1000 |
commit | b6fba854007bb4392846085a60178c44dbd7989e (patch) | |
tree | b3027d6982bc41ec86796849e43d855508faa8a1 /mediagoblin/templates | |
parent | 15ddb7c0ec936e42091f3c8cd7c41273f5ab94ba (diff) | |
download | mediagoblin-b6fba854007bb4392846085a60178c44dbd7989e.tar.lz mediagoblin-b6fba854007bb4392846085a60178c44dbd7989e.tar.xz mediagoblin-b6fba854007bb4392846085a60178c44dbd7989e.zip |
Decode request.query_string before use.
This doesn't seem to be an issue in my Guix SD/Python 3.7 testing, but hit an
issue on Debian 9/Python3.5 where concatenating text to `request.query_string`
was causing the error:
TypeError: a bytes-like object is required, not 'str'
This clearly hasn't been an issue in the past though, so I suspect there's a
library somewhere that's on a different version and is behaving differently.
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r-- | mediagoblin/templates/mediagoblin/moderation/report_panel.html | 12 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/moderation/user_panel.html | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/mediagoblin/templates/mediagoblin/moderation/report_panel.html b/mediagoblin/templates/mediagoblin/moderation/report_panel.html index c82cd412..52a6ad87 100644 --- a/mediagoblin/templates/mediagoblin/moderation/report_panel.html +++ b/mediagoblin/templates/mediagoblin/moderation/report_panel.html @@ -35,10 +35,10 @@ <h2>{% trans %}Active Reports Filed{% endtrans %}</h2> {% if report_list.count() %} {% if not active_settings.last_page == 1 %} - {% if 'active_p='~active_settings.current_page in request.query_string %} - {% set query_string = request.query_string %}{% else %} + {% if 'active_p='~active_settings.current_page in request.query_string.decode() %} + {% set query_string = request.query_string.decode() %}{% else %} {% set query_string = -'active_p='~active_settings.current_page~"&"+request.query_string %} +'active_p='~active_settings.current_page~"&"+request.query_string.decode() %} {% endif %} <div class="right_align"> {% set first_vis = active_settings.current_page-3 %} @@ -127,10 +127,10 @@ curr_page !=p %} <h2>{% trans %}Closed Reports{% endtrans %}</h2> {% if closed_report_list.count() %} {% if not closed_settings.last_page == 1 %} - {% if 'closed_p='~closed_settings.current_page in request.query_string %} - {% set query_string = request.query_string %}{% else %} + {% if 'closed_p='~closed_settings.current_page in request.query_string.decode() %} + {% set query_string = request.query_string.decode() %}{% else %} {% set query_string = -'closed_p='~closed_settings.current_page~"&"+request.query_string %} +'closed_p='~closed_settings.current_page~"&"+request.query_string.decode() %} {% endif %} <div class="right_align"> {% set first_vis = closed_settings.current_page-3 %} diff --git a/mediagoblin/templates/mediagoblin/moderation/user_panel.html b/mediagoblin/templates/mediagoblin/moderation/user_panel.html index 4949960e..4046fecd 100644 --- a/mediagoblin/templates/mediagoblin/moderation/user_panel.html +++ b/mediagoblin/templates/mediagoblin/moderation/user_panel.html @@ -35,10 +35,10 @@ {% if user_list.count() %} {% if not last_page == 1 %} - {% if 'p='~current_page in request.query_string %} - {% set query_string = request.query_string %}{% else %} + {% if 'p='~current_page in request.query_string.decode() %} + {% set query_string = request.query_string.decode() %}{% else %} {% set query_string = -'p='~current_page~"&"+request.query_string %} +'p='~current_page~"&"+request.query_string.decode() %} {% endif %} <div class="right_align"> {% set first_vis = current_page-3 %} |