[API] organization an location are not used on user creation
Summary
When using the API to crete a user, and defining the organization
and location
attributes, these attributes are accepted by the server but the returned object has a null
value for both. Other attributes are properly handled.
Updating the user afterwards (CURL -X PUT .../v4/users/:id
) works fine.
Steps to reproduce
The following curl command can be used to reproduce the problem:
curl -X POST http://gitlab.lxd/api/v4/users -H 'PRIVATE-TOKEN: REDACTED' -H 'Content-type: application/json' --data '{"username": "wayne4", "email": "bruce.wayne4@wayne-entreprises.com", "name": "Bruce Wayne4", "organization": "Wayne Entreprises", "reset_password": true, "website_url": "http://waynes.go", "location": "Gotham City"}'
Sample output:
{"name":"Bruce Wayne4","username":"wayne4","id":1,"organization":null,"location":null,...}
What is the current bug behavior?
organization
and location
are not defined in the created object.
What is the expected correct behavior?
organization
and location
should be defined.
Results of GitLab environment info
Gitlab 9.5.2 installed from omnibus packages.
System information
System: Ubuntu 16.04
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 12.0.0
Redis Version: 3.2.5
Git Version: 2.13.5
Sidekiq Version:5.0.4
Go Version: unknown
GitLab information
Version: 9.5.2
Revision: ab97415
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: http://gitlab.lxd
HTTP Clone URL: http://gitlab.lxd/some-group/some-project.git
SSH Clone URL: git@gitlab.lxd:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 5.8.0
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
Initial bug report on python-gitlab: https://github.com/python-gitlab/python-gitlab/issues/264