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):