-
-
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 4 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 |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
|
||
from django import template | ||
|
||
from readthedocs.projects.utils import get_projects_last_owner | ||
from readthedocs.projects.version_handling import comparable_version | ||
|
||
|
||
register = template.Library() | ||
|
||
|
||
|
@@ -25,3 +25,9 @@ def sort_version_aware(versions): | |
def is_project_user(user, project): | ||
"""Return if user is a member of project.users.""" | ||
return user in project.users.all() | ||
|
||
|
||
@register.filter | ||
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. Is there a reason why this is a filter rather than just data set on the context in 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. Sorry for the late reply. After reading the code again and the one on .com, I think it was because we need to override this on .com, but I'll see if I can use the SetttingsObjectOverride pattern here 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. Managed to get it working with SettingsOverride :) |
||
def projects_last_owner(user): | ||
"""Returns projects where `user` is the last owner.""" | ||
return get_projects_last_owner(user) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{% extends "profiles/base_profile_edit.html" %} | ||
|
||
{% load i18n %} | ||
{% load projects_tags %} | ||
|
||
{% block title %}{% trans "Delete Account" %}{% endblock %} | ||
|
||
|
@@ -9,12 +10,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 next projects and all its information will be deleted. | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</p> | ||
<ul> | ||
{% for project in user|projects_last_owner %} | ||
<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.