From 9bb13e9694a8fd1526932fe296f8b50fcdd8ebf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Saba=C5=82a?= Date: Mon, 25 Apr 2022 09:55:52 +0200 Subject: [PATCH] ADX-833 Make search helper accepts Iterable to be py3 & py2 compatible. --- ckanext/scheming/helpers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ckanext/scheming/helpers.py b/ckanext/scheming/helpers.py index e4889b6e..3c7e34bb 100644 --- a/ckanext/scheming/helpers.py +++ b/ckanext/scheming/helpers.py @@ -74,8 +74,7 @@ def scheming_natural_sort(llist): Sorts a list of tuples with strings "naturally". I.e 1,2...11 and not 1,11,2.. """ - llist.sort(key=lambda key: [convert(c) for c in re.split('([0-9]+)', key[0])]) - return llist + return sorted(llist, key=lambda key: [convert(c) for c in re.split('([0-9]+)', key[0])]) @helper