Skip to content

Commit

Permalink
Fix duplicated tags from tasks
Browse files Browse the repository at this point in the history
Without this change if there are more than one task with a tag that is
not recodred in the database then the tag is duplicated.

Signed-off-by: Simó Albert i Beltran <[email protected]>
  • Loading branch information
sim6 committed May 23, 2024
1 parent 142c6fa commit 532afc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions errands/lib/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,9 @@ def add_tag(self, tag: str) -> None:
self.tags = new_tags

def update_tags(self) -> None:
tasks_tags_texts: list[str] = []
tasks_tags_texts: set[str] = set()
for task in self.tasks:
tasks_tags_texts.extend(task.tags)
tasks_tags_texts.update(task.tags)

current_tags = self.tags
current_tags_texts = [t.text for t in current_tags]
Expand Down

0 comments on commit 532afc9

Please sign in to comment.