From 5465f945beb821b777bfb5d263de2608b155f917 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:04:15 +1300 Subject: [PATCH] old cross posts --- app/post/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/post/routes.py b/app/post/routes.py index 49174d03..6ba329d5 100644 --- a/app/post/routes.py +++ b/app/post/routes.py @@ -1008,7 +1008,7 @@ def post_delete_post(community: Community, post: Post, user_id: int, federate_al old_cross_posts = Post.query.filter(Post.id.in_(post.cross_posts)).all() post.cross_posts.clear() for ocp in old_cross_posts: - if ocp.cross_posts is not None: + if ocp.cross_posts is not None and post.id in ocp.cross_posts: ocp.cross_posts.remove(post.id) post.delete_dependencies() post.deleted = True