🐛 [todoist2org] Fix wrong section tags

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.
This commit is contained in:
Marcel Kapfer 2022-11-26 08:01:29 +01:00
parent 877c6783fe
commit 20b17be7b3
Signed by: mmk2410
GPG Key ID: CADE6F0C09F21B09
1 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ def parse_task(task, subtask, additional_labels):
return output return output
def parse_sections(project_id, tasks, additional_labels): def parse_sections(project_id, tasks, project_label):
"""Print a section.""" """Print a section."""
output = [] output = []
sections = api.get_sections(project_id=project_id) 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(f"* {section.name}")
output.append("") output.append("")
section_slug = get_filename(section.name, False) section_slug = get_filename(section.name, False)
additional_labels.append(section_slug) additional_labels = [*project_label, section_slug]
subtask = False subtask = False
for task in tasks: for task in tasks:
if task.section_id == section.id: if task.section_id == section.id: