Skip to content

Commit

Permalink
Inherit the parent's tags when creating a new subtask.
Browse files Browse the repository at this point in the history
If a parent is provided during task creation, all tags
of the parent are added to the newly created task.

Fixes GitHub issue #1078
  • Loading branch information
gycsaba96 authored and diegogangl committed May 16, 2024
1 parent c726c4d commit b32ec93
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions GTG/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,11 @@ def new(self, title: str = None, parent: UUID = None) -> Task:

self.add(task, parent)

# add the tags of the parent
if parent is not None:
for tag in self.lookup[parent].tags:
task.add_tag(tag)

return task


Expand Down

0 comments on commit b32ec93

Please sign in to comment.