Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Triggering and Update Title of Admin Privileges Email #858

Merged
merged 4 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading