This commit is contained in:
Aevann1 2022-01-11 22:21:50 +02:00
parent 07483f7991
commit af6b74f614
2 changed files with 4 additions and 4 deletions

View file

@ -68,7 +68,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 author.is_private and author.id != v.id 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"}
return render_template(f"{template}search.html",
@ -216,7 +216,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 author.is_private and author.id != v.id 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"}