From 12e6e55cb4dbb2b3681a3c54f19b16576b63cd5f Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:16:11 +1200 Subject: [PATCH] avoid "list.remove(x): x not in list" --- app/activitypub/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/activitypub/util.py b/app/activitypub/util.py index 3e2bb810..30181631 100644 --- a/app/activitypub/util.py +++ b/app/activitypub/util.py @@ -1549,7 +1549,7 @@ def update_post_from_activity(post: Post, request_json: dict): 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) if post is not None: