diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-08-12 14:34:27 -0300 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-08-12 14:54:29 -0300 |
commit | cce7b837e4180167d426224ef625e12a8abc4994 (patch) | |
tree | 33716957d809f3345317ee91c9fb067c996eb761 /py-fake-service/app/search | |
parent | 103180329b3aad65fa816056c2ca2e9f51424507 (diff) |
updating tags on py-fake-service
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 |