From 0617bb154cdadc4506c44ab0d83fe2c0c25a632a Mon Sep 17 00:00:00 2001 From: justcool393 Date: Thu, 29 Sep 2022 22:44:32 -0700 Subject: [PATCH] use get_post to handle getting a post (#381) why did we ever catch an exception throw it away, then catch an exception (something get_post already does) and then finally get the post --- files/routes/posts.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index b3606298a..3ab4cf17c 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -105,16 +105,7 @@ def submit_get(v, sub=None): @app.get("/logged_out/h//post//") @auth_desired_with_logingate def post_id(pid, anything=None, v=None, sub=None): - - try: pid = int(pid) - except Exception as e: pass - - - try: pid = int(pid) - except: abort(404) - post = get_post(pid, v=v) - if not post.can_see(v): abort(403) if post.over_18 and not (v and v.over_18) and session.get('over_18', 0) < int(time.time()):