This commit is contained in:
Aevann1 2021-12-05 20:58:46 +02:00
parent 6f73012258
commit 5d258ae3a6
3 changed files with 14 additions and 18 deletions

View file

@ -429,25 +429,20 @@ def all_comments(v):
sort=request.values.get("sort", "new")
t=request.values.get("t", defaulttimefilter)
if request.values.get("shadowbanned") and v and v.admin_level > 1:
idlist = comment_idlist(v=v,
page=page,
sort=sort,
t=t,
shadowbanned=true
)
comments = get_comments(idlist, v=v, shadowbanned=True)
else:
idlist = comment_idlist(v=v,
page=page,
sort=sort,
t=t,
)
comments = get_comments(idlist, v=v)
if request.values.get("shadowbanned") and v and v.admin_level > 1: shadowbanned = True
else: shadowbanned = False
idlist = comment_idlist(v=v,
page=page,
sort=sort,
t=t,
shadowbanned=shadowbanned
)
comments = get_comments(idlist, v=v, shadowbanned=shadowbanned)
next_exists = len(idlist) > 25
idlist = idlist[:25]
if request.headers.get("Authorization"): return {"data": [x.json for x in comments]}
else: return render_template("home_comments.html", v=v, sort=sort, t=t, page=page, comments=comments, standalone=True, next_exists=next_exists)
else: return render_template("home_comments.html", v=v, sort=sort, t=t, page=page, comments=comments, standalone=True, next_exists=next_exists, shadowbanned=shadowbanned)