From 9fbcfcf00f5a98d4d7e1d3fed6541b433ee0b124 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 5 Sep 2017 03:41:09 -0400 Subject: [PATCH] Sort the list of root cabinets. Thanks to Thomas Plotkowiak for the request. Signed-off-by: Roberto Rosario --- HISTORY.rst | 2 ++ mayan/apps/cabinets/views.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 45f298d46c..dbc4043f4d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,8 @@ document properties edited events. Preserve the user that initially creates the document. GitLab issue #433. Thanks to Jesaja Everling (@jeverling) for the report. +- Sort the list of root cabinets. Thanks to Thomas Plotkowiak + for the request. 2.7.1 (2017-09-03) diff --git a/mayan/apps/cabinets/views.py b/mayan/apps/cabinets/views.py index 6b418ca7ac..0fed347728 100644 --- a/mayan/apps/cabinets/views.py +++ b/mayan/apps/cabinets/views.py @@ -153,7 +153,9 @@ class CabinetListView(SingleObjectListView): } def get_object_list(self): - return Cabinet.objects.root_nodes() + # Add explicit ordering of root nodes since the queryset returned + # is not affected by the model's order Meta option. + return Cabinet.objects.root_nodes().order_by('label') class DocumentCabinetListView(CabinetListView):