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

Fixes #37192 - Use with_enabled_email scope #10901

Merged
merged 2 commits into from
Feb 29, 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
2 changes: 1 addition & 1 deletion app/lib/actions/katello/capsule_content/sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def notify_on_failure(_plan)
notification = MailNotification[:proxy_sync_failure]
proxy = SmartProxy.find(input.fetch(:smart_proxy, {})[:id])
subjects = subjects(input[:options]).merge(smart_proxy: proxy)
notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
notification.users.with_enabled_email.each do |user|
notification.deliver(subjects.merge(user: user, task: task))
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/lib/actions/katello/content_view/promote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def plan(version, environments, is_force = false, description = nil, incremental
def notify_on_failure(_plan)
notification = MailNotification[:content_view_promote_failure]
view = ::Katello::ContentView.find(input.fetch(:content_view, {})[:id])
notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
notification.users.with_enabled_email.each do |user|
notification.deliver(user: user, content_view: view, task: task)
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/lib/actions/katello/content_view/publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def trigger_capsule_sync(_execution_plan)
def notify_on_failure(_plan)
notification = MailNotification[:content_view_publish_failure]
view = ::Katello::ContentView.find(input.fetch(:content_view, {})[:id])
notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
notification.users.with_enabled_email.each do |user|
notification.deliver(user: user, content_view: view, task: task)
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/lib/actions/katello/repository/sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def rescue_strategy
def notify_on_failure(_plan)
notification = MailNotification[:repository_sync_failure]
repo = ::Katello::Repository.find(input.fetch(:repository, {})[:id])
notification.users.where(disabled: [nil, false], mail_enabled: true).each do |user|
notification.users.with_enabled_email.each do |user|
notification.deliver(user: user, repo: repo, task: task)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/katello/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# rubocop:disable Metrics/BlockLength

Foreman::Plugin.register :katello do
requires_foreman '>= 3.7'
requires_foreman '>= 3.11'
register_gettext

sub_menu :top_menu, :content_menu, :caption => N_('Content'),
Expand Down
Loading