feedbacks: don't send redundant dmails when user is banned or loses approver status.

When a user is banned, send them a "You have been banned" dmail instead of a "Your user record has
been updated" dmail.

When a user loses approver status due to inactivity, don't seen them a "Your user record has been
updated" dmail for the "Lost approver privileges" neutral feedback they receive.
This commit is contained in:
evazion
2022-11-20 16:39:36 -06:00
parent bbe32f5e5d
commit 001ce99dd3
4 changed files with 23 additions and 10 deletions

View File

@@ -29,7 +29,7 @@ module ApproverPruner
inactive_approvers.each do |user|
CurrentUser.scoped(User.system) do
user.update!(level: User::Levels::CONTRIBUTOR)
user.feedback.create(category: "neutral", body: "Lost approval privileges", creator: User.system)
user.feedback.create!(category: "neutral", body: "Lost approval privileges", creator: User.system, disable_dmail_notification: true)
Dmail.create_automated(
to_id: user.id,