Skip to content

Commit f880706

Browse files
committed
fix: small db-specific fix
1 parent d579204 commit f880706

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

othello/apps/games/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def latest(self, **kwargs: Any) -> "models.query.QuerySet[Submission]":
2727
"""
2828
Returns a set of all the latest submissions for all users
2929
"""
30-
return self.filter(**kwargs).distinct("user")
30+
return self.filter(**kwargs).distinct("user").order_by("user", "-created_at")
3131

3232

3333
class Submission(models.Model):

othello/static/js/games/design.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ function playerSort(el) {
4141
username = el.text.match(/\(([^)]+)\)/)[1];
4242
}
4343
// sort descending by year, if it is part of the username, and then alphabetically
44-
// if username begins with year, sort by year, then alphabetically
4544
if(username.match(/^\d{4}/)){
4645
// first four numbers are year
4746
let year = username.substring(0, 4);
@@ -73,8 +72,8 @@ window.onload = function () {
7372
}
7473
});
7574
$("#id_white").selectize({
76-
maxItems: 1,
7775
options: players,
76+
maxItems: 1,
7877
onChange: function (val) {
7978
showYourselfHelp(val, "#white-help");
8079
},

0 commit comments

Comments
 (0)