RESTORE CACHE
This commit is contained in:
parent
a3dc329a79
commit
fe25f41fad
8 changed files with 78 additions and 38 deletions
|
@ -833,10 +833,16 @@ 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)
|
||||
|
||||
|
||||
|
@ -920,9 +926,15 @@ 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')
|
||||
|
@ -1101,8 +1113,11 @@ 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):
|
||||
|
@ -1111,6 +1126,10 @@ 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