From e9e8d246850cafd8bc7a0ea61d3c034839e673b2 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 20 Jun 2025 16:04:27 +0200 Subject: [PATCH] bring back plan natural sorting --- hub/services/views/pricelist.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hub/services/views/pricelist.py b/hub/services/views/pricelist.py index 6e89f97..4d12ee1 100644 --- a/hub/services/views/pricelist.py +++ b/hub/services/views/pricelist.py @@ -144,6 +144,15 @@ def pricelist(request): .prefetch_related("prices") .order_by("group__order", "group__name", "cloud_provider__name", "name") ) + # Restore natural sorting of compute plan names + compute_plans = sorted( + compute_plans, + key=lambda p: ( + p.group.order if p.group else 999, + p.group.name if p.group else "ZZZ", + natural_sort_key(p.name), + ), + ) # Fetch all appcat price configurations (prefetch addons) appcat_prices_qs = (