Skip to content

User: delete organizations where the user is the last owner #9164

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

Merged
merged 6 commits into from
May 11, 2022

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented May 4, 2022

This also shows a warning with a list of projects/organizations to be
deleted

Screenshot 2022-05-03 at 18-52-25 Delete Account Read the Docs

Fixes https://github.com/readthedocs/readthedocs-corporate/issues/742

This also shows a warning with a list of projects/organizations to be
deleted.
@stsewd stsewd requested a review from a team as a code owner May 4, 2022 00:03
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

This is a good refactor, just a couple things before it's ready to merge I think 👍

Comment on lines 150 to 155
def only_owner(self, user):
"""
Returns projects where `user` is the only owner.

Projects that belong to organizations aren't included.
"""
Copy link
Member

Choose a reason for hiding this comment

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

Reading the comment here I think it's clear. What about naming this method "solo_owner" instead? I think it's easier to read and will avoid the confusion that I had in the previous comment. cc @ericholscher

Note this also applies for the method in the organization manager

Copy link
Member

@ericholscher ericholscher May 10, 2022

Choose a reason for hiding this comment

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

solo doesn't seem more clear to me than only. We can probably be more verbose if needed.. is_single_owner? But I think the original name is mostly fine.

Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't prepend is_ to it because I'd expect a Yes/No (boolean) answer in that case. I think Project.objects.single_owner works better for me than only_onwer 👍🏼

Copy link
Member

Choose a reason for hiding this comment

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

single_owner seems good 👍

<ul>
{% for project in organization.projects.all %}
<li>
<a href="{{ project.get_absolute_url }}">{{ project.slug }}</a>
Copy link
Member

Choose a reason for hiding this comment

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

We should present this with Project: or similar.

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

This looks pretty much done to me, with the small wording change. I don't feel super strongly about it, but clarity here is important given that we're deleting stuff.

@stsewd stsewd enabled auto-merge (squash) May 11, 2022 23:49
@stsewd stsewd merged commit bb45582 into main May 11, 2022
@stsewd stsewd deleted the delete-org-last-owner branch May 11, 2022 23:57
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