Skip to content

Commit

Permalink
fix: var ovverride in for-loop (closes #201)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraanzu committed Nov 10, 2024
1 parent 83ee2ab commit 0d0db91
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dooit/backport/migrate_from_v2.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +11,7 @@

manager.connect()
BASE_PATH = Path(user_data_dir("dooit"))
operations = []


def parse_recurrence(recurrence: str) -> timedelta:
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 0d0db91

Please sign in to comment.