Skip to content

Commit

Permalink
W fix subtasks
Browse files Browse the repository at this point in the history
  • Loading branch information
diegogangl committed Jul 10, 2022
1 parent 4f07c7a commit 7224a81
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions GTG/gtk/editor/taskview.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,15 @@ def insert(self, text: str) -> None:
# Insert subtasks. Remove existing subtasks from the list, we
# will delete the rest at the end
for sub in subtasks.copy():
self.insert_existing_subtask(*sub)
try:
_sub = self.ds.tasks.get(sub[0])
self.insert_existing_subtask(_sub, sub[1])

if sub[0] in self.ds.tasks.lookup.keys():
subtasks.remove(sub)
if sub[0] in self.ds.tasks.lookup.keys():
subtasks.remove(sub)
except KeyError:
# The task has been deleted
pass

# Remove non-existing subtasks (subtasks that have been deleted)
for sub in subtasks:
Expand Down

0 comments on commit 7224a81

Please sign in to comment.