-
Notifications
You must be signed in to change notification settings - Fork 996
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
Removing a project with OIDC configured fails #15729
Comments
Manual workaround for now: >>> from warehouse.oidc.models import GitHubPublisher
>>> pub = db.query(GitHubPublisher).filter_by(repository_owner='redacted', repository_name='redacted').one()
>>> db.delete(pub)
>>> db.commit() |
Unfortunately not -- it's a many-many relationship, since other PyPI projects could have the same publisher registered. So I think we want to persist the publisher unless it's the last project associated with it, in which case it can be deleted 🙂 |
Oh, I see - I must have misread the relationships. Instead of removing the publisher itself, then maybe the related It works for publisher-side delete - when I ran the code above to remove the publisher, it removed the association as well. |
Yeah, that makes sense to me! |
Resolves pypi#15729 Signed-off-by: Mike Fiedler <[email protected]>
When removing a project via admin (such as malware), currently the removal fails, presumably due to not having an on delete cascade for the foreign key relationship.
We probably want to delete a publisher on project removal, since it's a one-to-one relationship, is that correct @woodruffw ?
We probably also want Admin UI functionality to remove an OIDC publisher from a project.
The text was updated successfully, but these errors were encountered: