Merge pull request #4425 from FinnStutzenstein/agendaProjectionHotfix

Hotfix for #4408
This commit is contained in:
Emanuel Schütze 2019-02-28 09:34:14 +01:00 committed by GitHub
commit 770de5b7d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -28,11 +28,12 @@ def get_flat_tree(all_data: AllData, parent_id: int = 0) -> List[Dict[str, Any]]
# Build a dict from an item_id to all its children
children: Dict[int, List[int]] = defaultdict(list)
for item in sorted(
all_data["agenda/item"].values(), key=lambda item: item["weight"]
):
if item["type"] == 1: # only normal items
children[item["parent_id"] or 0].append(item["id"])
if "agenda/item" in all_data:
for item in sorted(
all_data["agenda/item"].values(), key=lambda item: item["weight"]
):
if item["type"] == 1: # only normal items
children[item["parent_id"] or 0].append(item["id"])
tree = []