From d0d609cc9c0a41ec98be1477900550d63f627b4a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 29 Jul 2021 07:11:21 +0200 Subject: [PATCH] fdfd --- drama/routes/posts.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drama/routes/posts.py b/drama/routes/posts.py index 27b2aa97c..758d47f1b 100644 --- a/drama/routes/posts.py +++ b/drama/routes/posts.py @@ -76,7 +76,6 @@ def submit_get(v): @app.get("/post//") @app.get("/api/v1/post/") @auth_desired -@public("read") def post_base36id(pid, anything=None, v=None): try: pid = int(pid) except Exception as e: pass @@ -240,10 +239,8 @@ def post_base36id(pid, anything=None, v=None): post.tree_comments() - return { - "html":lambda:post.rendered_page(v=v, sort=sort), - "api":lambda:jsonify(post.json) - } + if "api" in request.path: return post.json + else: return post.rendered_page(v=v, sort=sort) @app.post("/edit_post/") @is_not_banned