Skip to content

Commit

Permalink
Add parent to self.add
Browse files Browse the repository at this point in the history
Since the default value for `UUID` is `None`, we can safely
avoid unnecessarily checking if `UUID` exists.
  • Loading branch information
TheEvilSkeleton authored and diegogangl committed Mar 15, 2024
1 parent e883141 commit 087f90c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions GTG/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,7 @@ def new(self, title: str = None, parent: UUID = None) -> Task:
task = Task(id=tid, title=title)
task.date_added = Date.now()

if parent:
self.add(task, parent)
else:
self.add(task)
self.add(task, parent)

return task

Expand Down

0 comments on commit 087f90c

Please sign in to comment.