Skip to content

Commit

Permalink
Merge pull request #858 from portagenetwork/aaron/issues/835-and-836
Browse files Browse the repository at this point in the history
Fix Triggering and Update Title of Admin Privileges Email
  • Loading branch information
aaronskiba authored Aug 19, 2024
2 parents a96bc6e + 67aa127 commit 209533f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 209533f

Please sign in to comment.