forked from rDrama/rDrama
Merge branch 'master' into db-seed
commit
ed05272a22
|
@ -231,7 +231,7 @@ def post_base36id(pid, anything=None, v=None):
|
||||||
post.views += 1
|
post.views += 1
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
g.db.commit()
|
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()):
|
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",
|
return {"html":lambda:render_template("errors/nsfw.html",
|
||||||
v=v,
|
v=v,
|
||||||
|
|
|
@ -44,7 +44,7 @@ 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")
|
||||||
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= 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)
|
return render_template("leaderboard.html", v=v, users1=users1, users2=users2)
|
||||||
|
|
||||||
@app.get("/@<username>/css")
|
@app.get("/@<username>/css")
|
||||||
|
|
Loading…
Reference in New Issue