diff options
Diffstat (limited to 'py-fake-service/app/search')
-rw-r--r-- | py-fake-service/app/search/search_query.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/py-fake-service/app/search/search_query.py b/py-fake-service/app/search/search_query.py index cb8d5f57..e8da89d8 100644 --- a/py-fake-service/app/search/search_query.py +++ b/py-fake-service/app/search/search_query.py @@ -48,8 +48,11 @@ class SearchQuery: self.compiled = compiled def test(self, mail): - if set(self.compiled.get('tags')).intersection(mail.tags) or 'all' in self.compiled.get('tags'): - return True + if set(self.compiled.get('not_tags')).intersection(set(mail.tags)): + return False + + if set(self.compiled.get('tags')).intersection(set(mail.tags)) or 'all' in self.compiled.get('tags'): + return True if self.compiled.get('general'): search_terms = re.compile(self.compiled['general']) @@ -59,6 +62,7 @@ class SearchQuery: if not self.compiled.get('tags') and not self.compiled.get('not_tags'): return True + return False |