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

Skip deleting users with protected/restricted relations #441

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

Urth
Copy link
Contributor

@Urth Urth commented Oct 23, 2023

Allow the registration profile cleanup to succeed when a user has protected or restricted relations. The cleanup assumes the users that are selected for cleanup have never been activated. But it is possible for an admin to activate a user without using the registration profile. When the user is then deactivated and the profile becomes a valid candidate for cleanup it may have associated records which prevent it from being deleted.

Allow the registration profile cleanup to succeed when a user has
protected or restricted relations. The cleanup assumes the users that
are selected for cleanup have never been activated. But it is possible
for an admin to activate a user without using the registration profile.
When the user is then deactivated and the profile becomes a valid
candidate for cleanup it may have associated records which prevent it
from being deleted.
Copy link
Collaborator

@joshblum joshblum left a comment

Choose a reason for hiding this comment

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

We may as well move the profile.delete() call into the try block as well, for good measure. Thanks!

@coveralls
Copy link

Coverage Status

coverage: 97.019% (-0.1%) from 97.162% when pulling 361852f on Urth:delete_protected_users into 4a4f90b on macropin:main.

@joshblum joshblum merged commit 6d71e8f into macropin:main Oct 27, 2023
5 of 6 checks passed
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.

3 participants