aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins
diff options
context:
space:
mode:
authorBen Sturmfels <ben@sturm.com.au>2020-04-09 15:29:51 +1000
committerBen Sturmfels <ben@sturm.com.au>2020-04-09 15:29:51 +1000
commitb6fba854007bb4392846085a60178c44dbd7989e (patch)
treeb3027d6982bc41ec86796849e43d855508faa8a1 /mediagoblin/plugins
parent15ddb7c0ec936e42091f3c8cd7c41273f5ab94ba (diff)
downloadmediagoblin-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/plugins')
-rw-r--r--mediagoblin/plugins/openid/templates/mediagoblin/plugins/openid/login.html5
-rw-r--r--mediagoblin/plugins/openid/templates/mediagoblin/plugins/openid/login_link.html2
2 files changed, 3 insertions, 4 deletions
diff --git a/mediagoblin/plugins/openid/templates/mediagoblin/plugins/openid/login.html b/mediagoblin/plugins/openid/templates/mediagoblin/plugins/openid/login.html
index 193a3b2d..4ebfdf54 100644
--- a/mediagoblin/plugins/openid/templates/mediagoblin/plugins/openid/login.html
+++ b/mediagoblin/plugins/openid/templates/mediagoblin/plugins/openid/login.html
@@ -41,13 +41,13 @@
{% endif %}
{% if allow_registration %}
<p>
- {% trans %}Log in to create an account!{% endtrans %}
+ {% trans %}Log in to create an account!{% endtrans %}
</p>
{% endif %}
{% template_hook('login_link') %}
{% if pass_auth is defined %}
<p>
- <a href="{{ request.urlgen('mediagoblin.auth.login') }}?{{ request.query_string }}">
+ <a href="{{ request.urlgen('mediagoblin.auth.login') }}?{{ request.query_string.decode() }}">
{%- trans %}Or login with a password!{% endtrans %}
</a>
</p>
@@ -63,4 +63,3 @@
</div>
</form>
{% endblock %}
-
diff --git a/mediagoblin/plugins/openid/templates/mediagoblin/plugins/openid/login_link.html b/mediagoblin/plugins/openid/templates/mediagoblin/plugins/openid/login_link.html
index fa4d5e85..78d66745 100644
--- a/mediagoblin/plugins/openid/templates/mediagoblin/plugins/openid/login_link.html
+++ b/mediagoblin/plugins/openid/templates/mediagoblin/plugins/openid/login_link.html
@@ -19,7 +19,7 @@
{% block openid_login_link %}
{% if openid_link is defined %}
<p>
- <a href="{{ request.urlgen('mediagoblin.plugins.openid.login') }}?{{ request.query_string }}">
+ <a href="{{ request.urlgen('mediagoblin.plugins.openid.login') }}?{{ request.query_string.decode() }}">
{%- trans %}Or login with OpenID!{% endtrans %}
</a>
</p>