Bug #24601
openPossible fix for external_usergroups_controller when using api/v2/usergroups/:usergroup/external_usergroups
Description
Hi all
I was creating a docker image for the 1.19 RC, with some initial configuration. For adding some user groups and testing the link to ldap I was using the REST api, more specifically a POST to api/v2/usergroups/:usergroup/external_usergroups as explained in API documentation. I was using this command, to create the external usergroup.
curl -s -H Accept:application/json -H Content-Type:application/json -k -u admin:changeme -X POST -d {“name”:“administrator”,“auth_source_id”:34} https://172.19.0.1/api/v2/usergroups/1/external_usergroups
I found an error using it, the server was complaining about: “Usergroup can’t be blank”, crashing with “NoMethodError: undefined method ‘users’ for nil:NilClass”. Even if I have no experience with ruby after some research, finally I fixed it modifiing the file app/controllers/api/v2/external_usergroups_controller.rb at the line 36. I include the resulting patch
Files
No data to display