allow ppl to search their own ghost comments
parent
9ef00b7f0e
commit
3a6481f3da
|
@ -73,8 +73,9 @@ def searchposts(v:User):
|
||||||
Post.private == False)
|
Post.private == False)
|
||||||
|
|
||||||
if 'author' in criteria:
|
if 'author' in criteria:
|
||||||
posts = posts.filter(Post.ghost == False)
|
|
||||||
author = get_user(criteria['author'], v=v)
|
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 not author.is_visible_to(v):
|
||||||
if v.client:
|
if v.client:
|
||||||
abort(403, f"@{author.username}'s profile is private; You can't use the 'author' syntax on them")
|
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:
|
if 'author' in criteria:
|
||||||
comments = comments.filter(Comment.ghost == False)
|
|
||||||
author = get_user(criteria['author'], v=v)
|
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 not author.is_visible_to(v):
|
||||||
if v.client:
|
if v.client:
|
||||||
abort(403, f"@{author.username}'s profile is private; You can't use the 'author' syntax on them")
|
abort(403, f"@{author.username}'s profile is private; You can't use the 'author' syntax on them")
|
||||||
|
|
Loading…
Reference in New Issue