From 20b17be7b3b05f02a8cbe796f6c3c84c8a78abec Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 26 Nov 2022 08:01:29 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[todoist2org]=20Fix=20wrong=20se?= =?UTF-8?q?ction=20tags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The list of additional labels (containing the project name and the section name) was not reset after parsing a section but only after parsing a project. This resulted in wrong additional labels being added to some tasks. --- todoist2org/todoist2org.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/todoist2org/todoist2org.py b/todoist2org/todoist2org.py index d76761e..506b3bb 100644 --- a/todoist2org/todoist2org.py +++ b/todoist2org/todoist2org.py @@ -111,7 +111,7 @@ def parse_task(task, subtask, additional_labels): return output -def parse_sections(project_id, tasks, additional_labels): +def parse_sections(project_id, tasks, project_label): """Print a section.""" output = [] sections = api.get_sections(project_id=project_id) @@ -121,7 +121,7 @@ def parse_sections(project_id, tasks, additional_labels): output.append(f"* {section.name}") output.append("") section_slug = get_filename(section.name, False) - additional_labels.append(section_slug) + additional_labels = [*project_label, section_slug] subtask = False for task in tasks: if task.section_id == section.id: