forked from rDrama/rDrama
master
parent
eec7d16dcc
commit
5f45455618
|
@ -50,7 +50,6 @@ def flagged_posts(v):
|
||||||
|
|
||||||
posts = g.db.query(Submission).filter_by(
|
posts = g.db.query(Submission).filter_by(
|
||||||
is_approved=0,
|
is_approved=0,
|
||||||
purged_utc=0,
|
|
||||||
is_banned=False
|
is_banned=False
|
||||||
).join(Submission.flags
|
).join(Submission.flags
|
||||||
).options(contains_eager(Submission.flags)
|
).options(contains_eager(Submission.flags)
|
||||||
|
@ -103,7 +102,6 @@ def flagged_comments(v):
|
||||||
posts = g.db.query(Comment
|
posts = g.db.query(Comment
|
||||||
).filter_by(
|
).filter_by(
|
||||||
is_approved=0,
|
is_approved=0,
|
||||||
purged_utc=0,
|
|
||||||
is_banned=False
|
is_banned=False
|
||||||
).join(Comment.flags).options(contains_eager(Comment.flags)
|
).join(Comment.flags).options(contains_eager(Comment.flags)
|
||||||
).order_by(Comment.id.desc()).offset(25 * (page - 1)).limit(26).all()
|
).order_by(Comment.id.desc()).offset(25 * (page - 1)).limit(26).all()
|
||||||
|
|
|
@ -42,15 +42,10 @@ def user_info(v, username):
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def leaderboard(v):
|
def leaderboard(v):
|
||||||
if v and v.is_banned and not v.unban_utc:return render_template("seized.html")
|
if v and v.is_banned and not v.unban_utc:return render_template("seized.html")
|
||||||
users1, users2 = leaderboard()
|
|
||||||
return render_template("leaderboard.html", v=v, users1=users1, users2=users2)
|
|
||||||
|
|
||||||
@cache.memoize(timeout=86400)
|
|
||||||
def leaderboard():
|
|
||||||
users = g.db.query(User).options(lazyload('*'))
|
users = g.db.query(User).options(lazyload('*'))
|
||||||
users1= sorted(users, key=lambda x: x.dramacoins, reverse=True)[:25]
|
users1= sorted(users, key=lambda x: x.dramacoins, reverse=True)[:25]
|
||||||
users2= sorted(users, key=lambda x: x.stored_subscriber_count, reverse=True)[:10]
|
users2= list(users.order_by(User.stored_subscriber_count).limit(10).all())
|
||||||
return users1, users2
|
return render_template("leaderboard.html", v=v, users1=users1, users2=users2)
|
||||||
|
|
||||||
@app.get("/@<username>/css")
|
@app.get("/@<username>/css")
|
||||||
def get_css(username):
|
def get_css(username):
|
||||||
|
|
Loading…
Reference in New Issue