Skip to content

Add checks if a user is only owner of org#20175

Open
JacobCoffee wants to merge 14 commits into
mainfrom
fix/org-orphan-on-user-delete
Open

Add checks if a user is only owner of org#20175
JacobCoffee wants to merge 14 commits into
mainfrom
fix/org-orphan-on-user-delete

Conversation

@JacobCoffee

@JacobCoffee JacobCoffee commented Jun 18, 2026

Copy link
Copy Markdown
Member
  1. Disallow users from deleting their account of they still retain an org.
  2. If admins delete an account, record it and deactivate it

The second option im not sure if its the right move or not. I would think either, in order of most preferred:

  • disallow nuking an account with orgs until they are dealt with (or optionally double nuke do delete all orgs that user has?)
  • do the recording but transfer orgs to the deleting admin
  • or push to a system account

Also for ref. there are currently ~22 orphaned orgs, one being of significance (in name)

Closes #20174

JacobCoffee and others added 4 commits June 17, 2026 19:16
List organizations the user solely owns alongside sole-owned projects,
with links to add an owner or delete the organization. Regenerate the
message catalog for the new translatable strings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- delete_account blocks when the user is the sole owner of an organization
- admin nuke deactivates sole-owned organizations and records the event

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JacobCoffee JacobCoffee requested a review from a team as a code owner June 18, 2026 00:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4544f7f12d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread warehouse/admin/views/users.py Outdated
Comment thread warehouse/manage/views/__init__.py
JacobCoffee and others added 7 commits June 17, 2026 19:33
default_response now includes the sole_organizations query; stub it like
active_projects so the test request stub needs no db.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- account deletion blocks only good-standing sole-owned orgs; non-good-standing
  ones are deactivated instead of trapping the user
- owner removal cancels the org's subscriptions (self-service and admin nuke)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JacobCoffee JacobCoffee changed the title Add checks if a user it only owner of org Add checks if a user is only owner of org Jun 18, 2026
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

Successfully merging this pull request may close these issues.

Organizations can be orphaned

1 participant