Bug #5750
closedCannot set default_organization_id at user creation
Description
https://bugzilla.redhat.com/show_bug.cgi?id=1092656
Created attachment 890865 [details]
part of /var/log/foreman/production.log
Description of problem:
Creation of an user via API with default_organization_id set fails with 500 ISE.
Version-Release number of selected component (if applicable):
Satellite-6.0.3-RHEL-6-20140423.1-Satellite-x86_64-dvd1.iso
How reproducible:
always
Steps to Reproduce:
1. Run @api.resource(:users).call(:create, user_hash) with following user_hash:
user_hash = {
:login => "newuser",
:firstname => "user",
:lastname => "new",
:mail => "root@localhost",
:auth_source_id => 1,
:password => "password",
:organization_ids => [13],
:default_organization_id => 13,
:location_ids => [],
:role_ids => [],
}
Actual results:
Creation of user failed with: 500 Internal Server Error: {
"error": {"message":"undefined method `key?' for #<JSON::Ext::Generator::State:0x007f696cecadd8>"}
}
but the user was created!
Expected results:
no exceptions or ISEs
Additional info:
- creating of the user without default_organization_id works and setting it using the user update API afterwards works as well
Updated by Dominic Cleal almost 11 years ago
- Project changed from Katello to Foreman
- Category set to API
- Status changed from New to Ready For Testing
- Assignee set to dustin tsang
- Target version set to 1.8.3
Updated by Anonymous almost 11 years ago
- Target version changed from 1.8.3 to 1.8.2
Updated by Dominic Cleal almost 11 years ago
- Has duplicate Bug #5666: Cannot set default_organization_id at user creation added
Updated by dustin tsang almost 11 years ago
The server is no longer giving a 500 internal error but a proper validation but proper validation is given.
Validation message and an example of a successful creation of a user can be seen in the link.
https://gist.github.com/dustint-rh/f3e0408e1cc937a8f4fb
Updated by Dominic Cleal almost 11 years ago
- Status changed from Ready For Testing to Rejected
- Target version deleted (
1.8.2)