From 1af61b0c50984d018b666c68039f94bd5d164b60 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Mon, 3 Jan 2022 22:56:23 -0800 Subject: [PATCH] fix(routers.packages): fix /packages/{name} relation ordering Conflicts, Provides and Replaces did not have consistent ordering with PHP. This patch fixes that issue. Closes #228 Signed-off-by: Kevin Morris --- aurweb/routers/packages.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/aurweb/routers/packages.py b/aurweb/routers/packages.py index ca37ff50..bb67f2fe 100644 --- a/aurweb/routers/packages.py +++ b/aurweb/routers/packages.py @@ -160,15 +160,18 @@ async def package(request: Request, name: str) -> Response: context["licenses"] = pkg.package_licenses conflicts = pkg.package_relations.filter( - models.PackageRelation.RelTypeID == CONFLICTS_ID) + models.PackageRelation.RelTypeID == CONFLICTS_ID + ).order_by(models.PackageRelation.RelName.asc()) context["conflicts"] = conflicts provides = pkg.package_relations.filter( - models.PackageRelation.RelTypeID == PROVIDES_ID) + models.PackageRelation.RelTypeID == PROVIDES_ID + ).order_by(models.PackageRelation.RelName.asc()) context["provides"] = provides replaces = pkg.package_relations.filter( - models.PackageRelation.RelTypeID == REPLACES_ID) + models.PackageRelation.RelTypeID == REPLACES_ID + ).order_by(models.PackageRelation.RelName.asc()) context["replaces"] = replaces return render_template(request, "packages/show.html", context)