forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-07-31 08:05:09 +02:00
parent 0f10c7a7fb
commit e2518a942a
3 changed files with 8 additions and 8 deletions

View File

@ -414,5 +414,5 @@ def all_comments(v):
idlist = idlist[0:25]
if request.headers.get("Authorization"): return [x.json for x in comments]
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)

View File

@ -223,7 +223,7 @@ def searchposts(v, search_type="posts"):
domain=None
domain_obj=None
if request.headers.get("Authorization"): return [x.json for x in posts]
if request.headers.get("Authorization"): return {"data": [x.json for x in posts]}
else: return render_template("search_comments.html", v=v, query=query, total=total, page=page, listing=posts, sort=sort, t=t, next_exists=next_exists, domain=domain, domain_obj=domain_obj, reasons=REASONS)
@ -248,7 +248,7 @@ def searchcomments(v):
comments = get_comments(ids, v=v)
if request.headers.get("Authorization"): return [x.json for x in comments]
if request.headers.get("Authorization"): return {"data": [x.json for x in comments]}
else: return render_template("search_comments.html", v=v, query=query, total=total, page=page, comments=comments, sort=sort, t=t, next_exists=next_exists)
@ -278,5 +278,5 @@ def searchusers(v, search_type="posts"):
users=users[:25]
if request.headers.get("Authorization"): return [x.json for x in users]
if request.headers.get("Authorization"): return {"data": [x.json for x in users]}
else: return render_template("search_users.html", v=v, query=query, total=total, page=page, users=users, sort=sort, t=t, next_exists=next_exists)

View File

@ -322,7 +322,7 @@ def u_username(username, v=None):
listing = get_posts(ids, v=v)
if u.unban_utc:
if request.headers.get("Authorization"): return [x.json for x in listing]
if request.headers.get("Authorization"): return {"data": [x.json for x in listing]}
else: return render_template("userpage.html",
u=u,
v=v,
@ -410,7 +410,7 @@ def u_username_comments(username, v=None):
is_following = (v and user.has_follower(v))
if request.headers.get("Authorization"): return [c.json for c in listing]
if request.headers.get("Authorization"): return {"data": [c.json for c in listing]}
else: return render_template("userpage_comments.html", u=user, v=v, listing=listing, page=page, sort=sort, t=t,next_exists=next_exists, is_following=is_following, standalone=True)
@app.get("/@<username>/info")
@ -498,7 +498,7 @@ def saved_posts(v, username):
listing = get_posts(ids, v=v)
if request.headers.get("Authorization"): return [x.json for x in listing]
if request.headers.get("Authorization"): return {"data": [x.json for x in listing]}
else: return render_template("userpage.html",
u=v,
v=v,
@ -523,7 +523,7 @@ def saved_comments(v, username):
listing = get_comments(ids, v=v)
if request.headers.get("Authorization"): return [x.json for x in listing]
if request.headers.get("Authorization"): return {"data": [x.json for x in listing]}
else: return render_template("userpage_comments.html",
u=v,
v=v,