Project

General

Profile

Actions

Bug #24601

open

Possible fix for external_usergroups_controller when using api/v2/usergroups/:usergroup/external_usergroups

Added by Gorka Benguria almost 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

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

20180809011901-foreman.patch 20180809011901-foreman.patch 763 Bytes Gorka Benguria, 08/13/2018 04:34 PM

No data to display

Actions

Also available in: Atom PDF