update messaging, dont delete janitor trials on promotion/deletion #2408
This commit is contained in:
@@ -11,18 +11,21 @@ class JanitorPruner
|
||||
|
||||
inactive_janitors.each do |user|
|
||||
CurrentUser.scoped(admin, "127.0.0.1") do
|
||||
janitor_trial = JanitorTrial.where(user_id: user.id).first
|
||||
|
||||
if janitor_trial
|
||||
janitor_trial.demote!
|
||||
unknown_level = nil
|
||||
else
|
||||
user.promote_to!(User::Levels::PLATINUM)
|
||||
unknown_level = "\n\nYour previous user level was unknown so your user level has defaulted to Platinum. If you feel this to be in error please reply to this message with your original level."
|
||||
end
|
||||
|
||||
Dmail.create_split(
|
||||
:to_id => user.id,
|
||||
:title => "Janitor inactivity",
|
||||
:body => "You haven't approved a post in the past two months. In order to make sure the list of active janitors is up-to-date, you have lost your janitor privileges. Please reply to this message if you want to be reinstated."
|
||||
:body => "You haven't approved a post in the past two months. In order to make sure the list of active janitors is up-to-date, you have lost your janitor privileges. Please reply to this message if you want to be reinstated.#{unknown_level}"
|
||||
)
|
||||
|
||||
janitor_trial = JanitorTrial.where(user_id: user.id).first
|
||||
if janitor_trial
|
||||
user.promote_to!(janitor_trial.original_level, :skip_feedback => true)
|
||||
else
|
||||
user.promote_to!(User::Levels::GOLD, :skip_feedback => true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user