From 083353fd9160c7afb05b8ea2925ce61589b08b80 Mon Sep 17 00:00:00 2001 From: kocio-pl Date: Sun, 3 Mar 2024 23:26:39 +0100 Subject: [PATCH] Update saved_searches.py --- GTG/core/saved_searches.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GTG/core/saved_searches.py b/GTG/core/saved_searches.py index fa361eabb0..10220c3c28 100644 --- a/GTG/core/saved_searches.py +++ b/GTG/core/saved_searches.py @@ -166,9 +166,10 @@ def new(self, name: str, query: str, parent: UUID = None) -> SavedSearch: search_id = uuid4() search = SavedSearch(id=search_id, name=name, query=query) - self.data.append(search) - self.lookup[search_id] = search - self.model.append(search) + if not self.find(name): + self.data.append(search) + self.lookup[search_id] = search + self.model.append(search) return search