mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -06:00
Also skip locked users in the job query
This commit is contained in:
parent
4aabc44264
commit
760465959f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user