Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update user with different username creates new user #355

Open
fbalak opened this issue Feb 14, 2018 · 0 comments
Open

Update user with different username creates new user #355

fbalak opened this issue Feb 14, 2018 · 0 comments

Comments

@fbalak
Copy link
Contributor

fbalak commented Feb 14, 2018

When any user (admin or normal) tries to change its user data via API:

curl -H 'Content-Type: application/json' -H 'Authorization: Bearer token' -XPUT -d '{"name":"Tom Hardy", "username":"thardy2", "email":"[email protected]", "role":"normal"}' http://127.0.0.1/api/1.0/users/thardy

and provide different username and email (same email returns message: is taken) than the one that the user already have then there is created a new user with the new provided username and empty role ("role": null) and the old user stays unchanged:

curl -H 'Content-Type: application/json' -H 'Authorization: Bearer token' -XGET http://127.0.0.1/api/1.0/users

Status: 200 OK
[{
  "email": "[email protected]",
  "username": "admin",
  "name": "Admin",
  "role": "admin",
  "email_notitifications": true
}, {
  "email": "[email protected]",
  "username": "thardy",
  "name": "Tom Hardy",
  "role": "admin",
  "email_notifications": false
}, {
  "email": "[email protected]",
  "username": "thardy2",
  "name": "Tom Hardy",
  "role": null,
  "email_notifications": false
}]

Tested with:

tendrl-ansible-1.5.4-1.el7.centos.noarch
tendrl-api-1.5.5-1.el7.centos.noarch
tendrl-api-httpd-1.5.5-1.el7.centos.noarch
tendrl-commons-1.5.5-1.el7.centos.noarch
tendrl-grafana-plugins-1.5.5-1.el7.centos.noarch
tendrl-grafana-selinux-1.5.4-2.el7.centos.noarch
tendrl-monitoring-integration-1.5.5-1.el7.centos.noarch
tendrl-node-agent-1.5.5-1.el7.centos.noarch
tendrl-notifier-1.5.5-1.el7.centos.noarch
tendrl-selinux-1.5.4-2.el7.centos.noarch
tendrl-ui-1.5.5-1.el7.centos.noarch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant