Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Cannot delete a user who owns releases. #1244

Open
mattk42 opened this issue Feb 14, 2017 · 4 comments
Open

Cannot delete a user who owns releases. #1244

mattk42 opened this issue Feb 14, 2017 · 4 comments

Comments

@mattk42
Copy link
Contributor

mattk42 commented Feb 14, 2017

I have a user who was an admin on our cluster and had pushed to multiple apps that he was not the owner for.

After transferring ownership of the apps that he owns to another user, I get the following when trying to delete him.

$ deis auth:cancel --username=someuser cancel account someuser at https://deis.mycluster.com? (y/N): y Error: Unknown Error (409): {"detail":"(\"Cannot delete some instances of model 'User' because they are referenced through a protected foreign key: 'Release.owner'\", <QuerySet [<Release: some-app-v7>, <Release: another-app-v10>]

@bacongobbler
Copy link
Member

Which version was this on? I believe this should be fixed in v2.11.0 with deis apps:transfer but I could be wrong.

@mattk42
Copy link
Contributor Author

mattk42 commented Feb 14, 2017

Oops, sorry for not including that. I am on v2.11.0. I did deis apps:transfer for the apps that he owned but the releases he is attached to otherwise are apps he had deployed to but did not actually own.

@mattk42
Copy link
Contributor Author

mattk42 commented Feb 14, 2017

As a workaround, I was able to to transfer those specific apps over to the user I want to delete and then back. This updated the release objects to now be owned by the correct user and I was able to delete the user in question.

I am not sure how better to handle the case where a user owns releases for an application but not the application itself, but it does seem like it may need some thought.

@Cryptophobia
Copy link
Contributor

This issue was moved to teamhephy/controller#29

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants