This commit is contained in:
Aevann1 2022-02-04 06:10:31 +02:00
parent 81527aaebf
commit e2771a7f14

View file

@ -64,6 +64,7 @@ def searchposts(v):
if 'author' in criteria:
posts = posts.filter(Submission.ghost == None)
author = get_user(criteria['author'])
if not author: return {"error": f"User not found"}
if author.is_private and author.id != v.id and v.admin_level < 2 and not v.eye:
@ -210,6 +211,7 @@ def searchcomments(v):
comments = g.db.query(Comment.id).filter(Comment.parent_submission != None)
if 'author' in criteria:
comments = comments.filter(Comment.ghost == None)
author = get_user(criteria['author'])
if not author: return {"error": f"User not found"}
if author.is_private and author.id != v.id and v.admin_level < 2 and not v.eye: