forked from rDrama/rDrama
Amend PR 52, 53: standardize style, basedbot bug
parent
f848f68799
commit
25b5675ac4
|
@ -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)}"
|
||||
|
|
|
@ -578,7 +578,7 @@ def messagereply(v:User):
|
|||
|
||||
@app.get("/2faqr/<secret>")
|
||||
@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("/@<username>")
|
||||
@app.get("/@<username>.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("/@<username>/posts")
|
||||
@app.get("/@<username>/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))
|
||||
|
|
Loading…
Reference in New Issue