From 65c277b5a6fe75b39ecebc5cacc67983f0cf926c Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 26 Jul 2023 16:19:50 +0300 Subject: [PATCH] fix 500 error --- files/routes/posts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 81ce085850..96b83d7e1c 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -290,11 +290,11 @@ def thumbnail_thread(pid:int, vid:int): else: return f"{post_url}/{fragment_url}" - p = db.query(Post).filter_by(id=pid).options(load_only(Post.url)).one() + p = db.query(Post).filter_by(id=pid).options(load_only(Post.url)).one_or_none() if not p or not p.url: time.sleep(5) - p = db.query(Post).filter_by(id=pid).options(load_only(Post.url)).one() + p = db.query(Post).filter_by(id=pid).options(load_only(Post.url)).one_or_none() if not p or not p.url: return