fdfddf
This commit is contained in:
parent
4d7e2e0a3c
commit
f5e19633f2
3 changed files with 16 additions and 1 deletions
|
@ -26,11 +26,14 @@ beams_client = PushNotifications(
|
|||
|
||||
@app.get("/comment/<cid>")
|
||||
@app.get("/post/<pid>/<anything>/<cid>")
|
||||
@app.get("/logged_out/comment/<cid>")
|
||||
@auth_desired
|
||||
def post_pid_comment_cid(cid, pid=None, anything=None, 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/comment/{cid}")
|
||||
|
||||
try: cid = int(cid)
|
||||
except:
|
||||
try: cid = int(cid, 36)
|
||||
|
|
|
@ -45,8 +45,14 @@ def submit_get(v):
|
|||
|
||||
@app.get("/post/<pid>")
|
||||
@app.get("/post/<pid>/<anything>")
|
||||
@app.get("/logged_out/post/<pid>")
|
||||
@auth_desired
|
||||
def post_id(pid, anything=None, 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/post/{pid}")
|
||||
|
||||
try: pid = int(pid)
|
||||
except Exception as e: pass
|
||||
|
||||
|
|
|
@ -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