From 4801d5ac847f67681a633d041cfa639780c4f12b Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 3 Aug 2019 23:25:37 -0500 Subject: move `Scheduler::JanitorScheduler::admin_account` to `ModerationHelper::janitor_account` --- app/helpers/moderation_helper.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/helpers') diff --git a/app/helpers/moderation_helper.rb b/app/helpers/moderation_helper.rb index b6fd7be53..730af2603 100644 --- a/app/helpers/moderation_helper.rb +++ b/app/helpers/moderation_helper.rb @@ -4,6 +4,12 @@ module ModerationHelper POLICIES = %w(silence unsilence suspend unsuspend force_unlisted allow_public force_sensitive allow_nonsensitive reset) EXCLUDED_DOMAINS = %w(tailma.ws monsterpit.net monsterpit.cloud monsterpit.gallery monsterpit.blog) + def janitor_account + account_id = ENV.fetch('JANITOR_USER', '').to_i + return if account_id == 0 + Account.find_by(id: account_id) + end + def account_policy(username, domain, policy, reason = nil) return if policy.blank? policy = policy.to_s -- cgit