Bug #3519
closed500 error when creating a duplicate organization
Description
Description of problem:
When trying to create an org in foreman when an org with the same name already exists, an ISE is thrown. This is incongruent with such behavior for other subcommands
Steps to Reproduce:
1. 'hammer -u admin -p admin organization create --name foobar' ; note org is created
2. 'hammer -u admin -p admin organization create --name foobar'
3. View results
Actual results:
[root@cloud-qe-21 ~]# hammer -u admin -p admin organization create --name foobar
Could not create the organization:
Error: 500 Internal Server Error
Expected results:
Something like "Organization creation failed: An organization with this name already exists"
Foreman production.log:
Started POST "/api/organizations" for ::1 at 2013-10-25 13:42:55 +0000 Processing by Api::V2::OrganizationsController#create as JSON Parameters: {"organization"=>{"name"=>"test"}} Authorized user admin(Admin User) undefined method `permission_failed?' for #<Organization:0x000000080a6218> (NoMethodError) /opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:in `method_missing' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in `method_missing' /usr/share/foreman/app/controllers/api/base_controller.rb:54:in `process_resource_error' /usr/share/foreman/app/controllers/api/base_controller.rb:71:in `process_response' /usr/share/foreman/app/controllers/concerns/api/v2/taxonomies_controller.rb:47:in `create'
Updated by Martin Bacovsky about 11 years ago
- Assignee set to Daniel Lobato Garcia
Updated by Dominic Cleal about 11 years ago
- Has duplicate Bug #4211: [RFE] Creating a duplicate org does not provide useful feedback added
Updated by Daniel Lobato Garcia about 11 years ago
- Status changed from New to Assigned
Updated by Dominic Cleal about 11 years ago
Taxonomies are missing Authorization, but in addition, the API error handler assumes all resources have it.
Updated by Daniel Lobato Garcia about 11 years ago
- Status changed from Assigned to Ready For Testing
Updated by Dominic Cleal about 11 years ago
- Translation missing: en.field_release set to 5
Updated by Daniel Lobato Garcia about 11 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 14fdd9046dd3b85979bf95b4d0019e00051e35c2.