Order Pong Highscores

I had expected the client to sort it and allow the user to choose
ordering by level or codepoints, but it only displays the results
in the order they are sent.
This commit is contained in:
Declan Hoare 2020-04-17 18:46:12 +10:00
parent 3d6f9adc38
commit 9eb12a165b

View file

@ -155,8 +155,8 @@ def get_display_name(uid, dbsession, authsession):
def get_pong_highscores(dbsession, authsession): def get_pong_highscores(dbsession, authsession):
return flask.jsonify({"Pages": 0, # unused return flask.jsonify({"Pages": 0, # unused
"Highscores": [mapping.map_to(user, mappings["PongHighscore"]) "Highscores": [mapping.map_to(user, mappings["PongHighscore"])
for user in dbsession.query(User).all() for user in dbsession.query(User).filter(User.PongLevel.isnot(None)).filter(User.PongCP.isnot(None))
if user.PongLevel is not None and user.PongCP is not None]}) .order_by(User.PongCP.desc()).all()]})
@api_route("/GetEmail") @api_route("/GetEmail")
def get_email(dbsession, authsession): def get_email(dbsession, authsession):