From 38f5b9404b050a71267c130eb9540a03248e95f1 Mon Sep 17 00:00:00 2001 From: Vitaly Date: Mon, 11 Mar 2013 17:33:54 +0400 Subject: [PATCH 1/2] Fix when tags is None --- src/sentry/plugins/bases/notify.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sentry/plugins/bases/notify.py b/src/sentry/plugins/bases/notify.py index 01854c7833fa88..86b7794bd48639 100644 --- a/src/sentry/plugins/bases/notify.py +++ b/src/sentry/plugins/bases/notify.py @@ -165,6 +165,8 @@ def should_notify(self, group, event): allowed_tags = project.get_option('notifcation:tags', {}) if allowed_tags: tags = event.data.get('tags', ()) + if not tags: + return False if not any(v in allowed_tags.get(k) for k, v in tags): return False return True From 3ce6b3e19bf6371182b3097ba359254ef5e0f78a Mon Sep 17 00:00:00 2001 From: Vitaly Date: Mon, 11 Mar 2013 19:27:30 +0400 Subject: [PATCH 2/2] =?UTF-8?q?Fixed=20using=20=E2=80=9Cin=E2=80=9D=20whit?= =?UTF-8?q?h=20non=20iterable=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sentry/plugins/bases/notify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry/plugins/bases/notify.py b/src/sentry/plugins/bases/notify.py index 86b7794bd48639..576cad966f794d 100644 --- a/src/sentry/plugins/bases/notify.py +++ b/src/sentry/plugins/bases/notify.py @@ -167,7 +167,7 @@ def should_notify(self, group, event): tags = event.data.get('tags', ()) if not tags: return False - if not any(v in allowed_tags.get(k) for k, v in tags): + if not any(v in allowed_tags.get(k, ()) for k, v in tags): return False return True