forked from rDrama/rDrama
1
0
Fork 0

Merge branch 'master' into db-seed

master
atrc445 2021-07-26 19:58:10 +02:00
commit ed05272a22
2 changed files with 2 additions and 2 deletions

View File

@ -231,7 +231,7 @@ def post_base36id(pid, anything=None, v=None):
post.views += 1
g.db.add(post)
g.db.commit()
if isinstance(session.get('over_18', 0), dict): session["over_18"] = 0
if post.over_18 and not (v and v.over_18) and not session.get('over_18', 0) >= int(time.time()):
return {"html":lambda:render_template("errors/nsfw.html",
v=v,

View File

@ -44,7 +44,7 @@ def leaderboard(v):
if v and v.is_banned and not v.unban_utc:return render_template("seized.html")
users = g.db.query(User).options(lazyload('*'))
users1= sorted(users, key=lambda x: x.dramacoins, reverse=True)[:25]
users2= list(users.order_by(User.stored_subscriber_count).limit(10).all())
users2= list(users.order_by(User.stored_subscriber_count.desc()).limit(10).all())
return render_template("leaderboard.html", v=v, users1=users1, users2=users2)
@app.get("/@<username>/css")