avoid "list.remove(x): x not in list"

This commit is contained in:
rimu 2024-04-09 19:16:11 +12:00
parent e29d4659e6
commit 12e6e55cb4

View file

@ -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: