-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Warn about projects to be deleted whe an account is deleted #6414
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
Changes from all commits
c13d569
b098dd2
c2453cb
2cf5e0b
231e0e5
d54c35e
4082366
2ff2170
b87eec3
5261ed9
af45f6d
c438c3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
|
||
from readthedocs.projects.version_handling import comparable_version | ||
|
||
|
||
register = template.Library() | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from django.contrib.auth.models import User | ||
from django.test import TestCase | ||
from django_dynamic_fixture import get | ||
|
||
from readthedocs.projects.models import Project | ||
from readthedocs.projects.utils import get_projects_only_owner | ||
|
||
|
||
class TestUtils(TestCase): | ||
|
||
def test_get_projects_only_owner(self): | ||
user = get(User) | ||
another_user = get(User) | ||
|
||
project_one = get( | ||
Project, | ||
slug='one', | ||
users=[user], | ||
main_language_project=None, | ||
) | ||
project_two = get( | ||
Project, | ||
slug='two', | ||
users=[user], | ||
main_language_project=None, | ||
) | ||
project_three = get( | ||
Project, | ||
slug='three', | ||
users=[another_user], | ||
main_language_project=None, | ||
) | ||
project_four = get( | ||
Project, | ||
slug='four', | ||
users=[user, another_user], | ||
main_language_project=None, | ||
) | ||
|
||
project_five = get( | ||
Project, | ||
slug='five', | ||
users=[], | ||
main_language_project=None, | ||
) | ||
|
||
expected = {project_one, project_two} | ||
self.assertEqual(expected, set(get_projects_only_owner(user))) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,31 @@ | |
{% block edit_content_header %} {% trans "Delete Account" %} {% endblock %} | ||
|
||
{% block edit_content %} | ||
|
||
{% block delete-warning %} | ||
<p> | ||
<p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe nested |
||
<strong>All projects where you are the only owner will be deleted.</strong> | ||
humitos marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Untranslated string here. Also is this the messaging we'll give to commercial users? |
||
If you want to keep a project, add another owner or transfer ownership. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we could add a subtitle here. What about something like this? Delete AccountAll projects where you are the only owner will be deleted. Projects to be deleteThe following projects and all their documentation will be deleted:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 on the heading, we can skip the paragraph below the heading which is redundant. |
||
The following projects and all their documentation will be deleted. | ||
</p> | ||
<ul> | ||
{% for project in projects_to_be_deleted %} | ||
<li> | ||
<a href="{{ project.get_absolute_url }}">{{ project.slug }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</p> | ||
{% endblock%} | ||
|
||
<form method="POST" action="."> | ||
{% csrf_token %} | ||
{{ form }} | ||
<div> | ||
<strong>{% trans "Be careful! This can not be undone!" %}</strong> | ||
</div> | ||
<input type="submit" name="submit" value="{% trans "Delete Account" %}" id="submit"/> | ||
</form> | ||
</form> | ||
|
||
{% endblock %} |
Uh oh!
There was an error while loading. Please reload this page.