make referrals work on original usernames

master
Aevann 2023-09-27 00:40:06 +03:00
parent c9aa92cc04
commit 324d1f5cd0
1 changed files with 2 additions and 6 deletions

View File

@ -151,13 +151,9 @@ def sign_up_get(v):
abort(403, "New account registration is currently closed. Please come back later!") abort(403, "New account registration is currently closed. Please come back later!")
if v: return redirect(SITE_FULL) if v: return redirect(SITE_FULL)
ref = request.values.get("ref") ref = request.values.get("ref", "")
if ref: ref_user = get_user(ref)
ref = ref.replace('\\', '').replace('_', '\_').replace('%', '').strip()
ref_user = g.db.query(User).filter(User.username.ilike(ref)).one_or_none()
else:
ref_user = None
if ref_user and (ref_user.id in session.get("history", [])): if ref_user and (ref_user.id in session.get("history", [])):
return render_template("login/sign_up_failed_ref.html"), 403 return render_template("login/sign_up_failed_ref.html"), 403