diff --git a/files/helpers/actions.py b/files/helpers/actions.py index c9b7988ed..1dd23a666 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -302,8 +302,10 @@ def execute_basedbot(c:Comment, level:int, body, post_target:post_target_type, v if not c.body.lower().startswith("based"): return posting_to_submission = isinstance(post_target, Submission) pill = based_regex.match(body) - if level == 1: basedguy = get_account(post_target.author_id) - else: basedguy = get_account(c.parent_comment.author_id) + if level == 1: + basedguy = get_account(post_target.author_id) if posting_to_submission else post_target + else: + basedguy = get_account(c.parent_comment.author_id) basedguy.basedcount += 1 if pill: if basedguy.pills: basedguy.pills += f", {pill.group(1)}" diff --git a/files/routes/users.py b/files/routes/users.py index f85aa47fc..1e3001ef7 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -578,7 +578,7 @@ def messagereply(v:User): @app.get("/2faqr/") @auth_required -def mfa_qr(secret, v:User): +def mfa_qr(v:User, secret:str): x = pyotp.TOTP(secret) qr = qrcode.QRCode( error_correction=qrcode.constants.ERROR_CORRECT_L @@ -715,7 +715,7 @@ def userpagelisting(user:User, site=None, v=None, page:int=1, sort="new", t="all @app.get("/@") @app.get("/@.json") @auth_desired_with_logingate -def u_username_wall(username:str, v:Optional[User]=None): +def u_username_wall(v:Optional[User], username:str): u = get_user(username, v=v, include_blocks=True, include_shadowbanned=False) if username != u.username: return redirect(f"/@{u.username}") @@ -829,7 +829,7 @@ def u_username_wall_comment(v:User, username:str, cid): @app.get("/@/posts") @app.get("/@/posts.json") @auth_desired_with_logingate -def u_username(v:Optional[User]=None, username:str): +def u_username(v:Optional[User], username:str): u = get_user(username, v=v, include_blocks=True, include_shadowbanned=False) if username != u.username: return redirect(SITE_FULL + request.full_path.replace(username, u.username))