master
Aevann1 2022-04-17 11:23:42 +02:00
parent 2bff85b439
commit 1f5fa278d0
3 changed files with 12 additions and 6 deletions

View File

@ -712,7 +712,8 @@ def badge_remove_post(v):
@admin_level_required(2)
def users_list(v):
page = int(request.values.get("page", 1))
try: page = int(request.values.get("page", 1))
except: page = 1
users = g.db.query(User).filter_by(is_banned=0
).order_by(User.created_utc.desc()
@ -868,7 +869,8 @@ def admin_link_accounts(v):
@admin_level_required(2)
def admin_removed(v):
page = int(request.values.get("page", 1))
try: page = int(request.values.get("page", 1))
except: page = 1
if page < 1: abort(400)
@ -894,7 +896,8 @@ def admin_removed(v):
@admin_level_required(2)
def admin_removed_comments(v):
page = int(request.values.get("page", 1))
try: page = int(request.values.get("page", 1))
except: page = 1
ids = g.db.query(Comment.id).join(User, User.id == Comment.author_id).filter(or_(Comment.is_banned==True, User.shadowbanned != None)).order_by(Comment.id.desc()).offset(25 * (page - 1)).limit(26).all()

View File

@ -12,7 +12,8 @@ from files.__main__ import app
@auth_required
def feeds_user(v=None, sort='hot', t='all'):
page = int(request.values.get("page", 1))
try: page = int(request.values.get("page", 1))
except: page = 1
ids, next_exists = frontlist(
sort=sort,

View File

@ -515,7 +515,8 @@ def random_post(v):
def all_comments(v):
page = int(request.values.get("page", 1))
try: page = int(request.values.get("page", 1))
except: page = 1
sort=request.values.get("sort", "new")
t=request.values.get("t", defaulttimefilter)
@ -603,7 +604,8 @@ def transfers(v):
if request.headers.get("Authorization"): return {"data": [x.json for x in comments.all()]}
page = int(request.values.get("page", 1))
try: page = int(request.values.get("page", 1))
except: page = 1
comments = comments.offset(25 * (page - 1)).limit(26).all()
next_exists = len(comments) > 25
comments = comments[:25]