Skip to content

Commit 1e05d28

Browse files
committed
Sorted categories alphabetically
1 parent 5821660 commit 1e05d28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/imio/pm/wsclient/browser/vocabularies.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from imio.pm.wsclient.config import TAL_EVAL_FIELD_ERROR
1111
from imio.pm.wsclient.interfaces import IPreferredMeetings
1212
from imio.pm.wsclient.interfaces import ISendableAnnexesToPM
13+
from natsort import humansorted
1314
from plone import api
1415
from plone.memoize import ram
1516
from Products.statusmessages.interfaces import IStatusMessage
@@ -225,7 +226,7 @@ def __call__(self, context):
225226
return SimpleVocabulary([])
226227
terms = []
227228
forcedCategoryExists = not forcedCategory and True or False
228-
for category in categories:
229+
for category in humansorted(categories, key=lambda x: getattr(x, "title")):
229230
if forcedCategory == category["id"]:
230231
forcedCategoryExists = True
231232
terms.append(SimpleTerm(unicode(category["id"]),

0 commit comments

Comments
 (0)