allow ppl to search their own ghost comments

pull/157/head
Aevann 2023-06-24 16:37:08 +03:00
parent 9ef00b7f0e
commit 3a6481f3da
1 changed files with 4 additions and 2 deletions

View File

@ -73,8 +73,9 @@ def searchposts(v:User):
Post.private == False)
if 'author' in criteria:
posts = posts.filter(Post.ghost == False)
author = get_user(criteria['author'], v=v)
if author.id != v.id:
posts = posts.filter(Post.ghost == False)
if not author.is_visible_to(v):
if v.client:
abort(403, f"@{author.username}'s profile is private; You can't use the 'author' syntax on them")
@ -211,8 +212,9 @@ def searchcomments(v:User):
if 'author' in criteria:
comments = comments.filter(Comment.ghost == False)
author = get_user(criteria['author'], v=v)
if author.id != v.id:
comments = comments.filter(Comment.ghost == False)
if not author.is_visible_to(v):
if v.client:
abort(403, f"@{author.username}'s profile is private; You can't use the 'author' syntax on them")