aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeclan Hoare <[email protected]>2020-04-17 18:46:12 +1000
committerDeclan Hoare <[email protected]>2020-04-17 18:46:12 +1000
commit9eb12a165b02aa0fc04bf48d710f5d005c25952f (patch)
treebb04613ba443904e81ecf4a5dcd5d1fa318c018f
parent3d6f9adc382761441a82977f0aeef32b4118f935 (diff)
downloadshiftgears-master.tar.gz
shiftgears-master.tar.bz2
shiftgears-master.zip
Order Pong HighscoresHEADmaster
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.
-rw-r--r--unite.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/unite.py b/unite.py
index b5515cc..678f09b 100644
--- a/unite.py
+++ b/unite.py
@@ -155,8 +155,8 @@ def get_display_name(uid, dbsession, authsession):
def get_pong_highscores(dbsession, authsession):
return flask.jsonify({"Pages": 0, # unused
"Highscores": [mapping.map_to(user, mappings["PongHighscore"])
- for user in dbsession.query(User).all()
- if user.PongLevel is not None and user.PongCP is not None]})
+ for user in dbsession.query(User).filter(User.PongLevel.isnot(None)).filter(User.PongCP.isnot(None))
+ .order_by(User.PongCP.desc()).all()]})
@api_route("/GetEmail")
def get_email(dbsession, authsession):