From 0d0db91b1c4504bc2688601643d31d94a2583f25 Mon Sep 17 00:00:00 2001 From: kraanzu Date: Sun, 10 Nov 2024 21:16:41 +0530 Subject: [PATCH] fix: var ovverride in for-loop (closes #201) --- dooit/backport/migrate_from_v2.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dooit/backport/migrate_from_v2.py b/dooit/backport/migrate_from_v2.py index 3349d79b..f4540650 100644 --- a/dooit/backport/migrate_from_v2.py +++ b/dooit/backport/migrate_from_v2.py @@ -1,4 +1,5 @@ import re +from functools import partial from datetime import datetime, timedelta from typing import List, Optional, Tuple from yaml import safe_load @@ -10,6 +11,7 @@ manager.connect() BASE_PATH = Path(user_data_dir("dooit")) +operations = [] def parse_recurrence(recurrence: str) -> timedelta: @@ -101,11 +103,11 @@ def create_workspace(self, data, parent=None): workspace = Workspace(description=description, parent_workspace=parent) workspace.save() - for workspace in child_workspaces: - self.create_workspace(workspace, parent=workspace) + for child in child_workspaces: + self.create_workspace(child, parent=workspace) - for todo in todos: - self.create_todo(todo, parent_workspace=workspace) + for child in todos: + self.create_todo(child, parent_workspace=workspace) def create_todo(self, data: List, parent_todo=None, parent_workspace=None): self_data = data[0]