From 760465959f8b4c3d9beb310ef5a791ed2d102174 Mon Sep 17 00:00:00 2001 From: riking Date: Sat, 13 Sep 2014 14:10:30 -0700 Subject: [PATCH] Also skip locked users in the job query --- app/jobs/scheduled/leader_promotions.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/jobs/scheduled/leader_promotions.rb b/app/jobs/scheduled/leader_promotions.rb index b7e067f61ea..52966056111 100644 --- a/app/jobs/scheduled/leader_promotions.rb +++ b/app/jobs/scheduled/leader_promotions.rb @@ -6,7 +6,7 @@ module Jobs def execute(args) # Demotions demoted_user_ids = [] - User.real.where(trust_level: TrustLevel[3]).find_each do |u| + User.real.where(trust_level: TrustLevel[3], trust_level_locked: false).find_each do |u| # Don't demote too soon after being promoted next if user.on_leader_grace_period? @@ -17,7 +17,9 @@ module Jobs end # Promotions - User.real.where(trust_level: TrustLevel[2]).where.not(id: demoted_user_ids).find_each do |u| + User.real.where(trust_level: TrustLevel[2], + trust_level_locked: false) + .where.not(id: demoted_user_ids).find_each do |u| Promotion.new(u).review_tl2 end end