Sort challenges by id (#1914)

* Sort challenges by ID as well as value in `/api/v1/challenges` to better standardize API output
This commit is contained in:
Connor Nelson
2021-06-16 11:54:31 -04:00
committed by GitHub
parent 241f5e49fa
commit 1dafc62fda

View File

@@ -227,7 +227,9 @@ class ChallengeList(Resource):
and_(Challenges.state != "hidden", Challenges.state != "locked")
)
chal_q = (
chal_q.filter_by(**query_args).filter(*filters).order_by(Challenges.value)
chal_q.filter_by(**query_args)
.filter(*filters)
.order_by(Challenges.value, Challenges.id)
)
# Iterate through the list of challenges, adding to the object which