mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
avoid invalid post urls
This commit is contained in:
parent
eedaddd851
commit
a056a02ac3
1 changed files with 2 additions and 2 deletions
|
@ -1384,7 +1384,7 @@ def restore_post_or_comment(object_json, aplog_id):
|
|||
to_restore.deleted_by = None
|
||||
community.post_count += 1
|
||||
to_restore.author.post_count += 1
|
||||
new_cross_posts = Post.query.filter(Post.id != to_restore.id, Post.url == to_restore.url, Post.deleted == False,
|
||||
new_cross_posts = Post.query.filter(Post.id != to_restore.id, Post.url == to_restore.url, Post.deleted == False, Post.url != None, Post.url != '',
|
||||
Post.posted_at > utcnow() - timedelta(days=6)).all()
|
||||
for ncp in new_cross_posts:
|
||||
if ncp.cross_posts is None:
|
||||
|
@ -1872,7 +1872,7 @@ def update_post_from_activity(post: Post, request_json: dict):
|
|||
if ocp.cross_posts is not None and post.id in ocp.cross_posts:
|
||||
ocp.cross_posts.remove(post.id)
|
||||
|
||||
new_cross_posts = Post.query.filter(Post.id != post.id, Post.url == post.url, Post.deleted == False,
|
||||
new_cross_posts = Post.query.filter(Post.id != post.id, Post.url == post.url, Post.deleted == False, Post.url != None, Post.url != '',
|
||||
Post.posted_at > utcnow() - timedelta(days=6)).all()
|
||||
for ncp in new_cross_posts:
|
||||
if ncp.cross_posts is None:
|
||||
|
|
Loading…
Add table
Reference in a new issue