From c32c3f70cdf4e9f113d24e2d9b875fe7052bc839 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 22 Feb 2020 00:26:55 -0600 Subject: fix auto-defang....... 2! --- app/workers/scheduler/defang_scheduler.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/workers/scheduler/defang_scheduler.rb b/app/workers/scheduler/defang_scheduler.rb index d7ba3907a..ea999572d 100644 --- a/app/workers/scheduler/defang_scheduler.rb +++ b/app/workers/scheduler/defang_scheduler.rb @@ -5,8 +5,8 @@ class Scheduler::DefangScheduler include ServiceAccountHelper def perform - User.where(defanged: false, last_fanged_at: nil).or(User.where('last_fanged_at <= ?', 15.minutes.ago)) do - |user| user.defang! + User.where(defanged: false, last_fanged_at: nil).or(User.where('last_fanged_at <= ?', 15.minutes.ago)) do |user| + user.defang! next unless user&.account.present? service_dm('announcements', user.account, "You are no longer in #{user.role} mode.", footer: 'auto-defang') end -- cgit