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

Bug: Can't change user group members #74

Closed
DanHammond opened this issue Jan 27, 2021 · 3 comments · Fixed by #288
Closed

Bug: Can't change user group members #74

DanHammond opened this issue Jan 27, 2021 · 3 comments · Fixed by #288
Assignees
Labels
api Issue related to the REST API bug Something isn't working

Comments

@DanHammond
Copy link

Page: project/{id}/environment/{id}/organisation-settings
Suspected reproduction steps:

  • Create a user
  • Add them to a group
  • Delete the user
  • Create another user
  • Try add this user to the group

Outcome:

  • Fails to add user
  • Shows wrong count of users for the group (still including deleted user)

API response:
400. User {id} does not exist in this organisation

Note:
Looks like it's still trying to post back the id for the deleted user

@dabeeeenster dabeeeenster self-assigned this Jan 27, 2021
@dabeeeenster
Copy link
Contributor

Thanks for the raised issue; we'll take a look.

@kyle-ssg
Copy link
Member

I have replicated this issue and confirm the following:

If a user belonging to a group is deleted from the organisation, the api does not update groups for that organisation. Even after refreshing, deleted users still belong to groups, which causes an error when attempting to update anything to do with the group.

Simplest replication:

  • create a group with 2 members
  • delete one of the members from the organisation
  • attempt to re-save the group

Even after refreshing the browser, the user is unable to save the group.

@kyle-ssg kyle-ssg transferred this issue from Flagsmith/flagsmith-frontend Jan 27, 2021
@dabeeeenster dabeeeenster added the bug Something isn't working label May 25, 2021
@milanjaros
Copy link
Contributor

milanjaros commented Sep 1, 2021

Confirming bug on both on-prem v2.7.3 and cloud.

POST https://api.flagsmith.com/api/v1/organisations/1213/groups/165/add-users/

{"user_ids":[1268]}

results in

HTTP 400 Bad Request
{"detail":"User 1268 does not exist in this organisation"}

Workaround:

  1. Create a new group with the same users
  2. Set proper Permissions to the new group in Project Settings
  3. Delete the old group

To prevent this, remove a user from all groups before you delete him.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants