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 #22325 - permit additional params #407

Merged
merged 1 commit into from
Feb 1, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/controllers/discovered_hosts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ def destroy
end

def edit
quick = params.delete(:quick_submit)
@host = ::ForemanDiscovery::HostConverter.to_managed(@host, true, false, discovered_host_params_host) unless @host.nil?
setup_host_class_variables
@override_taxonomy = true
if params[:quick_submit]
# need to permit this one but don't know how
if quick
perform_update(@host, _('Successfully provisioned %s') % @host.name)
else
@host.build = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module HostsControllerExtensions
# etc.. expect a params[:host] to work.
def set_discovered_params
return if params[:discovered_host].nil?
params[:host] ||= params[:discovered_host]
params[:host] ||= params.delete(:discovered_host)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a case where both host and discovered_host were present, but fixed it in core theforeman/foreman@d7d633d

end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/functional/discovered_hosts_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_edit_form_quick_submit
assert managed_host.build
assert_redirected_to host_url(managed_host)
assert_equal hostgroup.id, managed_host.hostgroup_id
assert_match /Successfully/, flash[:notice]
assert_match(/Successfully/, flash[:notice])
end
end

Expand Down