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

fix: allow leaving account if invitation sent #1005

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

migmartri
Copy link
Member

@migmartri migmartri commented Jun 20, 2024

In the scenario where a user sent an invitation to another, and that person stayed in the organization. The user then couldn't delete the account.

This fixes it by making sure that the invitations are removed.

*ent.ConstraintError
ent: constraint failed: ERROR: update or delete on table "users" violates foreign key constraint "org_invitations_users_sender" on table "org_invitations" (SQLSTATE 23503)

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Copy link
Member

@jiparis jiparis left a comment

Choose a reason for hiding this comment

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

In general, I'd prefer logical deletes and anonymizing instead (for auditing, reporting, etc). We can review it if you want.

@migmartri
Copy link
Member Author

In general, I'd prefer logical deletes and anonymizing instead (for auditing, reporting, etc). We can review it if you want.

I agree, let's revisit this later. So far, our constants are focused on consistency.

@migmartri migmartri merged commit 944be3f into chainloop-dev:main Jun 21, 2024
13 checks passed
@migmartri migmartri deleted the fix-deletion branch June 21, 2024 08:24
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.

None yet

2 participants