fdfddf
This commit is contained in:
parent
4d7e2e0a3c
commit
f5e19633f2
3 changed files with 16 additions and 1 deletions
|
@ -272,11 +272,15 @@ def visitors(v):
|
|||
viewers=sorted(v.viewers, key = lambda x: x.last_view_utc, reverse=True)
|
||||
return render_template("viewers.html", v=v, viewers=viewers)
|
||||
|
||||
|
||||
@app.get("/@<username>")
|
||||
@app.get("/logged_out/@<username>")
|
||||
@auth_desired
|
||||
def u_username(username, v=None):
|
||||
if v and v.is_banned and not v.unban_utc: return render_template("seized.html")
|
||||
|
||||
if not v and "logged_out" not in request.path: return redirect(f"/logged_out/@{username}")
|
||||
|
||||
# username is unique so at most this returns one result. Otherwise 404
|
||||
|
||||
# case insensitive search
|
||||
|
@ -388,12 +392,14 @@ def u_username(username, v=None):
|
|||
is_following=(v and u.has_follower(v)))
|
||||
|
||||
|
||||
|
||||
@app.get("/@<username>/comments")
|
||||
@app.get("/logged_out/@<username>/comments")
|
||||
@auth_desired
|
||||
def u_username_comments(username, v=None):
|
||||
if v and v.is_banned and not v.unban_utc: return render_template("seized.html")
|
||||
|
||||
if not v and "logged_out" not in request.path: return redirect(f"/logged_out/@{username}/comments")
|
||||
|
||||
# username is unique so at most this returns one result. Otherwise 404
|
||||
|
||||
# case insensitive search
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue