From 37af9ad1c08ed590f9c0b8fbb3ac920f9fdc7e90 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 27 Sep 2019 20:23:01 +0100 Subject: [PATCH] Pass next URL to OAuth --- app.py | 6 ++++++ templates/item.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index aadd506..d2eebc2 100755 --- a/app.py +++ b/app.py @@ -115,6 +115,12 @@ def set_url_args(**new_args): args = {k: v for k, v in args.items() if v is not None} return url_for(request.endpoint, **args) +@app.template_global() +def current_url(): + args = request.view_args.copy() + args.update(request.args) + return url_for(request.endpoint, **args) + @app.before_request def init_profile(): g.profiling = [] diff --git a/templates/item.html b/templates/item.html index dfdb11e..3a5e578 100644 --- a/templates/item.html +++ b/templates/item.html @@ -88,7 +88,7 @@ -

Connect with Wikidata +

Connect with Wikidata {% endif %} {% if username %}