diff --git a/CHANGELOG.md b/CHANGELOG.md index 7732ce4653..822b6f507d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +### Fixed + + - Fix triggering and title of autosent email when a user's admin privileges are changed [#858](https://github.com/portagenetwork/roadmap/pull/858) + +## [4.1.1+portage-4.1.3] - 2024-08-08 + ### Changed - Bump rexml from 3.2.8 to 3.3.3 [#839](https://github.com/portagenetwork/roadmap/pull/839) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index def9e66356..1e241f5fbf 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -85,10 +85,8 @@ def admin_update_permissions end elsif perms.include? perm @user.perms << perm - if perm.id == Perm.use_api.id - @user.keep_or_generate_token! - privileges_changed = true - end + @user.keep_or_generate_token! if perm.id == Perm.use_api.id + privileges_changed = true end end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index e863a2ba2b..b7c6e21f48 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -195,7 +195,7 @@ def admin_privileges(user) I18n.with_locale I18n.locale do mail(to: user.email, - subject: format(_('Administrator privileges granted in %{tool_name}'), + subject: format(_('Administrator privileges updated in %{tool_name}'), tool_name: tool_name)) end end