From d768598c0e9444bc8006543aab7818d6a6296a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Thu, 9 Dec 2021 16:15:17 +0100 Subject: [PATCH] /~o/r/refs/r: sort artifacts by filename Now they're returned in SQL iteration order (by primary key?), which sucks really bad if there's a few groups of similar artifacts which get displayed in an effectively-random order --- gitsrht/blueprints/repo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py index d615e5a..bc0d0a0 100644 --- a/gitsrht/blueprints/repo.py +++ b/gitsrht/blueprints/repo.py @@ -630,6 +630,7 @@ def ref(owner, repo, ref): .filter(Artifact.user_id == repo.owner_id) .filter(Artifact.repo_id == repo.id) .filter(Artifact.commit == tag.target.hex)).all() + artifacts.sort(key=lambda ar: ar.filename) return render_template("ref.html", view="refs", owner=owner, repo=repo, git_repo=git_repo, tag=tag, signature=lookup_signature(git_repo, ref)[1], -- 2.38.4