-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
This also shows a warning with a list of projects/organizations to be deleted.
There was a problem hiding this 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 👍
readthedocs/projects/querysets.py
Outdated
def only_owner(self, user): | ||
""" | ||
Returns projects where `user` is the only owner. | ||
|
||
Projects that belong to organizations aren't included. | ||
""" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
👍🏼
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
This also shows a warning with a list of projects/organizations to be
deleted
Fixes https://github.com/readthedocs/readthedocs-corporate/issues/742