From dae538196dc2bb905354c82e2e490f5bd61e53db Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Fri, 22 Jun 2018 00:23:05 +0200 Subject: [PATCH] Tweak the remote follow Previously, it was 500ing if the profile already started with an @ --- app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 8a239ac..dbfd372 100644 --- a/app.py +++ b/app.py @@ -364,10 +364,11 @@ def remote_follow(): return render_template("remote_follow.html") csrf.protect() + profile = request.form.get("profile") + if not profile.startswith("@"): + profile = f"@{profile}" return redirect( - get_remote_follow_template("@" + request.form.get("profile")).format( - uri=f"{USERNAME}@{DOMAIN}" - ) + get_remote_follow_template(profile).format(uri=f"{USERNAME}@{DOMAIN}") )