From 8c25a48d0cfd6ba112d6287e9d3a0dafd4852c53 Mon Sep 17 00:00:00 2001 From: bAWario <22641966+bAWario@users.noreply.github.com> Date: Thu, 14 Apr 2022 00:23:46 +0200 Subject: [PATCH 2/3] Glowiefied Checkmark (#226) Co-authored-by: Captain --- files/templates/comments.html | 2 +- files/templates/submission.html | 2 +- files/templates/submission_listing.html | 2 +- files/templates/userpage.html | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index bd4ab6606..c6674d695 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -204,7 +204,7 @@ House {{c.author.house}} {% endif %} - {% if c.author.verified %} + {% if c.author.verified %} {% endif %} {% if not c.author %} {{c.print()}} diff --git a/files/templates/submission.html b/files/templates/submission.html index 9afd7e09d..f9aff0837 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -649,7 +649,7 @@ House {{p.author.house}} {% endif %} - {% if p.author.verified %} + {% if p.author.verified %} {% endif %} {{p.author_name}}{% if p.author.customtitle %}  {{p.author.customtitle | safe}}{% endif %} {% endif %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index fce286798..90789af04 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -192,7 +192,7 @@ House {{p.author.house}} {% endif %} - {% if p.author.verified %} + {% if p.author.verified %} {% endif %} {{p.author_name}}{% if p.author.customtitle %}  {{p.author.customtitle | safe}}{% endif %} {% endif %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 05efab4d0..66b9504cc 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -64,7 +64,7 @@ {% endif %} {% if u.verified %} - + {% endif %} {% if u.admin_level > 1 or (u.admin_level == 1 and not(v and v.admin_level > 1)) %} @@ -385,7 +385,7 @@ {% endif %} {% if u.verified %} -   +   {% endif %} {% if u.admin_level > 1 or (u.admin_level == 1 and not(v and v.admin_level > 1)) %} From 5d6885e5bf1195555cf246e00744ecc7b8bcb9e6 Mon Sep 17 00:00:00 2001 From: reality500 <103607984+reality500@users.noreply.github.com> Date: Wed, 13 Apr 2022 18:54:32 -0400 Subject: [PATCH 3/3] Add logged_out redirect (#227) --- files/routes/static.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/files/routes/static.py b/files/routes/static.py index 6e6c8990c..9d3b964a8 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -16,6 +16,24 @@ def rdrama(id, title): id = ''.join(f'{x}/' for x in id) return redirect(f'/archives/drama/comments/{id}{title}.html') +@app.get('/logged_out/') +@app.get('/logged_out/') +def logged_out(old = ""): + # Remove trailing question mark from request.full_path which flask adds if there are no query parameters + redirect_url = request.full_path.replace("/logged_out", "", 1) + if redirect_url.endswith("?"): + redirect_url = redirect_url[:-1] + + # Handle cases like /logged_out?asdf by adding a slash to the beginning + if not redirect_url.startswith('/'): + redirect_url = f"/{redirect_url}" + + # Prevent redirect loop caused by visiting /logged_out/logged_out/logged_out/etc... + if redirect_url.startswith('/logged_out'): + abort(400) + + return redirect(redirect_url) + @app.get("/privacy") @auth_required def privacy(v): @@ -438,4 +456,4 @@ def googleplayapp(): @app.post("/dismiss_mobile_tip") def dismiss_mobile_tip(): session["tooltip_last_dismissed"] = int(time.time()) - return "", 204 \ No newline at end of file + return "", 204