Actions
Bug #4537
closedUnsetting roles via API does not work
Description
When user tries to set empty array of role_ids, he receives
{ "error": { "message": "undefined method `uniq' for nil:NilClass" } }
Started PUT "/foreman/api/users/13" for 127.0.0.1 at 2014-03-04 09:40:34 +0100 Processing by Api::V1::UsersController#update as JSON Parameters: {"user"=>{"login"=>"somelogin", "role_ids"=>nil}, "apiv"=>"v1", "id"=>"13"} User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]] Setting current user thread-local variable to admin User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."login" = '13' ORDER BY firstname LIMIT 1 User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 13 ORDER BY firstname LIMIT 1 (0.2ms) BEGIN (0.1ms) ROLLBACK undefined method `uniq' for nil:NilClass (NoMethodError) /home/ares/Projekty/Zdrojaky/foreman/app/models/user.rb:272:in `role_ids_with_change_detection='
Updated by Marek Hulán over 10 years ago
- Status changed from Assigned to Ready For Testing
- Translation missing: en.field_release set to 4
Updated by Marek Hulán over 10 years ago
Updated by Marek Hulán over 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 615ff08551d0c1fc0cce667b1d57be929dbf92a7.
Actions