23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'app/controllers/katello/concerns/organizations_controller_extensions.rb', line 23
def create
if taxonomy_class == Organization
begin
@taxonomy = Organization.new(resource_params)
sca = ::Foreman::Cast.to_bool(params[:simple_content_access])
::Katello::OrganizationCreator.new(@taxonomy, sca: sca).create!
@taxonomy.reload
switch_taxonomy
if @count_nil_hosts > 0
redirect_to send("step2_#{taxonomy_single}_path", @taxonomy)
else
process_success(:object => @taxonomy, :success_redirect => send("edit_#{taxonomy_single}_path", @taxonomy))
end
rescue ActiveRecord::RecordInvalid
process_error(:render => "taxonomies/new", :object => @taxonomy)
rescue StandardError => ex
process_error(:render => "taxonomies/new", :object => @taxonomy, :error_msg => ex.message)
end
else
super
end
end
|