From c8b4838157342332e37ee6fe70c1e52f919a0ba9 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 3 Jul 2022 06:34:29 +0200 Subject: [PATCH] unmessing with queries --- files/helpers/get.py | 4 ++-- files/routes/posts.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/helpers/get.py b/files/helpers/get.py index e2f5e6cdc..37724c7f1 100644 --- a/files/helpers/get.py +++ b/files/helpers/get.py @@ -147,7 +147,7 @@ def get_post(i, v=None, graceful=False, rendered=False): posts = post.options( joinedload(Submission.flags), joinedload(Submission.awards), - joinedload(Submission.author).joinedload(User.badges), + joinedload(Submission.author), joinedload(Submission.options).joinedload(SubmissionOption.votes) ) @@ -203,7 +203,7 @@ def get_posts(pids, v=None): isouter=True ).options(joinedload(Submission.flags), joinedload(Submission.awards), - joinedload(Submission.author).joinedload(User.badges), + joinedload(Submission.author), joinedload(Submission.options).joinedload(SubmissionOption.votes) ).all() diff --git a/files/routes/posts.py b/files/routes/posts.py index 5053ff3b6..81df96306 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -174,7 +174,7 @@ def post_id(pid, anything=None, v=None, sub=None): joinedload(Comment.child_comments), joinedload(Comment.flags), joinedload(Comment.awards), - joinedload(Comment.author).joinedload(User.badges), + joinedload(Comment.author), joinedload(Comment.options).joinedload(CommentOption.votes) )