|
|
|
@ -13,6 +13,8 @@ bp = Blueprint("leaderboard", "leaderboard")
|
|
|
|
|
@bp.route("/leaderboards/top_posters")
|
|
|
|
|
def top_posters():
|
|
|
|
|
top_posters = {}
|
|
|
|
|
posts = rw_cache('top_posters')
|
|
|
|
|
if not posts:
|
|
|
|
|
posts = Post.select().where(Post.approved==True)
|
|
|
|
|
for post in posts:
|
|
|
|
|
transfers = []
|
|
|
|
@ -26,6 +28,9 @@ def top_posters():
|
|
|
|
|
|
|
|
|
|
top_posters[post.submitter]["amount"] += float(total)
|
|
|
|
|
top_posters[post.submitter]["posts"].append(post)
|
|
|
|
|
rw_cache('top_posters', top_posters)
|
|
|
|
|
else:
|
|
|
|
|
top_posters = posts
|
|
|
|
|
|
|
|
|
|
return render_template("leaderboard.html", posters=top_posters)
|
|
|
|
|
|
|
|
|
|