From 6c3426d266a7dfcfcdcf17a8d05abb837f71107d Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 11 Jan 2017 11:25:04 -0500 Subject: [PATCH] Let's not notify for trust levels on Staff, either --- app/services/badge_granter.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/badge_granter.rb b/app/services/badge_granter.rb index 206ffc14ed7..426e24ee8e0 100644 --- a/app/services/badge_granter.rb +++ b/app/services/badge_granter.rb @@ -274,7 +274,7 @@ class BadgeGranter /*where*/ RETURNING id, user_id, granted_at ) - select w.*, username, locale, u.admin FROM w + select w.*, username, locale, (u.admin OR u.moderator) AS staff FROM w JOIN users u on u.id = w.user_id " @@ -315,7 +315,7 @@ class BadgeGranter # Make this variable in this scope notification = nil - next if (row.admin && badge.awarded_for_trust_level?) + next if (row.staff && badge.awarded_for_trust_level?) I18n.with_locale(notification_locale) do notification = Notification.create!(