-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Notify the user when deleting a superproject #5596
Conversation
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.
Can you put a screenshot of how it looks like? Also, feels like the message should go in the template itself, rather than in python code
@stsewd Also, I have updated the code. |
@@ -6,6 +6,11 @@ | |||
{% block content-header %}<h1>{% blocktrans with project.name as name %}Delete {{ name }}?{% endblocktrans %}</h1>{% endblock %} | |||
|
|||
{% block content %} | |||
|
|||
{% if is_superproject %} | |||
<p>This project has subprojects under it. Deleting this will make them as regular projects. This will effect the URLs of the subprojects and they will be served normally as other projects.</p> |
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 put a link to the subprojects page here has subprojects...
Also, the paragraph needs to be marked for translation
'This project <a href="/dashboard/pip/subprojects/">has subprojects</a> under it. ' | ||
'Deleting this will make them as regular projects. ' | ||
'This will effect the URLs of the subprojects and they will be served normally as other projects.', | ||
' '.join(resp_content.split()) # this is done to remove all escapte sequences and new lines characters. |
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 think you can avoid this by using the trimmed
option in the blocktrans
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.
Thank you.
I have updated the PR.
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.
Thanks, I left to someone else to review the copy
|
||
response = self.client.get('/dashboard/pip/delete/') | ||
self.assertEqual(response.status_code, 200) | ||
self.assertIn( |
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.
assertContains is a shorcut for this https://docs.djangoproject.com/en/2.2/topics/testing/tools/#django.test.SimpleTestCase.assertContains
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.
Thank you.
This was a nice shortcut.
I have updated the PR.
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.
status code is also checked by assertContains ;)
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.
Default is already 200.
Should we write it here explictly?
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.
Default is fine
Mention that all the subproject's URLs will break.
OK. I tried to do a change suggestion and I did it wrong and a proper commit was created. I updated the copy on the test as well. I think this is ready to be merged. @stsewd do you agree? |
Closes #3742