fix: keep order of vgroups filter if no order_by provided

This commit is contained in:
relikd
2022-12-21 00:50:32 +01:00
parent 14a7fe848f
commit 2e7cc026f6

View File

@@ -1,5 +1,5 @@
from lektor.context import get_ctx from lektor.context import get_ctx
from typing import TYPE_CHECKING, Set, Union, Iterable, Iterator from typing import TYPE_CHECKING, Set, List, Union, Iterable, Iterator
import weakref import weakref
from .util import split_strip from .util import split_strip
if TYPE_CHECKING: if TYPE_CHECKING:
@@ -68,7 +68,7 @@ class VGroups:
GroupByRef.of(builder).make_once(keys) # ensure did cluster before use GroupByRef.of(builder).make_once(keys) # ensure did cluster before use
# find groups # find groups
proc_list = [record] proc_list = [record]
done_list = set() # type: Set[GroupBySource] done_list = [] # type: List[GroupBySource]
while proc_list: while proc_list:
page = proc_list.pop(0) page = proc_list.pop(0)
if recursive and hasattr(page, 'children'): if recursive and hasattr(page, 'children'):
@@ -80,7 +80,7 @@ class VGroups:
continue continue
if keys and vobj().config.key not in keys: if keys and vobj().config.key not in keys:
continue continue
done_list.add(vobj()) done_list.append(vobj())
# manage config dependencies # manage config dependencies
deps = set() # type: Set[str] deps = set() # type: Set[str]