Fix leaderboard 500 on production (NotImplementedError) (#563)

* leaderboard: correct LB set when !ENABLE_SERVICES

* leaderboard: fix NotImplementedError

UserBlockLeaderboard did not, in fact, implement `value_func`. Nor did
its superclass. The bug was replicated by having at least one UserBlock
in the test data.
This commit is contained in:
Snakes 2023-03-29 18:45:28 -04:00 committed by GitHub
parent 1f7e7afad3
commit 1cf017c42a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View file

@ -382,7 +382,9 @@ def leaderboard(v:User):
# note: lb_downvotes_received and lb_upvotes_given are global variables
# that are populated by leaderboard_thread() in files.helpers.services
leaderboards = [coins, coins_spent, truescore, subscribers, posts, comments, received_awards, badges, blocks, lb_downvotes_received, lb_upvotes_given]
leaderboards = [coins, coins_spent, truescore, subscribers, posts, comments, received_awards, badges, blocks]
if lb_downvotes_received is not None and lb_upvotes_given is not None:
leaderboards.extend([lb_downvotes_received, lb_upvotes_given])
return render_template("leaderboard.html", v=v, leaderboards=leaderboards)