This commit is contained in:
Aevann1 2022-01-11 00:43:00 +02:00
parent 15ece2c2d7
commit 4679b3b328
11 changed files with 24 additions and 18 deletions

View file

@ -67,6 +67,7 @@ def searchposts(v):
if 'author' in criteria:
author = get_user(criteria['author'])
if not author: return {"error": f"User not found"}
if author.is_private and v.admin_level < 2 and not v.eye:
if request.headers.get("Authorization"):
return {"error": f"@{author.username}'s profile is private; You can't use the 'author' syntax on them"}
@ -214,6 +215,7 @@ def searchcomments(v):
if 'author' in criteria:
author = get_user(criteria['author'])
if not author: return {"error": f"User not found"}
if author.is_private and v.admin_level < 2 and not v.eye:
if request.headers.get("Authorization"):
return {"error": f"@{author.username}'s profile is private; You can't use the 'author' syntax on them"}