parent
fe25f41fad
commit
91540c161a
8 changed files with 38 additions and 78 deletions
|
@ -833,16 +833,10 @@ def visitors(v):
|
|||
|
||||
|
||||
@app.get("/@<username>")
|
||||
@app.get("/logged_out/@<username>")
|
||||
@auth_desired
|
||||
def u_username(username, v=None):
|
||||
|
||||
|
||||
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
|
||||
|
||||
if v and request.path.startswith('/logged_out'): v = None
|
||||
|
||||
|
||||
u = get_user(username, v=v)
|
||||
|
||||
|
||||
|
@ -926,15 +920,9 @@ def u_username(username, v=None):
|
|||
|
||||
|
||||
@app.get("/@<username>/comments")
|
||||
@app.get("/logged_out/@<username>/comments")
|
||||
@auth_desired
|
||||
def u_username_comments(username, v=None):
|
||||
|
||||
|
||||
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
|
||||
|
||||
if v and request.path.startswith('/logged_out'): v = None
|
||||
|
||||
user = get_user(username, v=v)
|
||||
|
||||
if username != user.username: return redirect(f'/@{user.username}/comments')
|
||||
|
@ -1113,11 +1101,8 @@ def remove_follow(username, v):
|
|||
return {"message": "Follower removed!"}
|
||||
|
||||
@app.get("/pp/<id>")
|
||||
@app.get("/logged_out/pp/<id>")
|
||||
@app.get("/uid/<id>/pic")
|
||||
@app.get("/logged_out/uid/<id>/pic")
|
||||
@app.get("/uid/<id>/pic/profile")
|
||||
@app.get("/logged_out/uid/<id>/pic/profile")
|
||||
@limiter.exempt
|
||||
@auth_desired
|
||||
def user_profile_uid(v, id):
|
||||
|
@ -1126,10 +1111,6 @@ def user_profile_uid(v, id):
|
|||
try: id = int(id, 36)
|
||||
except: abort(404)
|
||||
|
||||
if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}")
|
||||
|
||||
if v and request.path.startswith('/logged_out'): v = None
|
||||
|
||||
x=get_account(id)
|
||||
return redirect(x.profile_url)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue