mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 10:03:21 -04:00
Don’t let people redact letter templates
It doesn’t work, so we shouldn’t show the link.
This commit is contained in:
@@ -70,12 +70,14 @@
|
|||||||
</span>
|
</span>
|
||||||
 
|
 
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not template._template.redact_personalisation %}
|
{% if template.template_type != 'letter' %}
|
||||||
<span class="page-footer-delete-link page-footer-delete-link-without-button">
|
{% if not template._template.redact_personalisation %}
|
||||||
<a href="{{ url_for('.confirm_redact_template', service_id=current_service.id, template_id=template.id) }}">Hide personalisation after sending</a>
|
<span class="page-footer-delete-link page-footer-delete-link-without-button">
|
||||||
</span>
|
<a href="{{ url_for('.confirm_redact_template', service_id=current_service.id, template_id=template.id) }}">Hide personalisation after sending</a>
|
||||||
{% else %}
|
</span>
|
||||||
<p class="hint">Personalisation is hidden after sending</p>
|
{% else %}
|
||||||
|
<p class="hint">Personalisation is hidden after sending</p>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1241,6 +1241,28 @@ def test_should_show_hint_once_template_redacted(
|
|||||||
assert page.select('.hint')[0].text == 'Personalisation is hidden after sending'
|
assert page.select('.hint')[0].text == 'Personalisation is hidden after sending'
|
||||||
|
|
||||||
|
|
||||||
|
def test_should_not_show_redaction_stuff_for_letters(
|
||||||
|
client_request,
|
||||||
|
mocker,
|
||||||
|
fake_uuid,
|
||||||
|
mock_get_service_letter_template,
|
||||||
|
single_letter_contact_block,
|
||||||
|
):
|
||||||
|
|
||||||
|
mocker.patch('app.main.views.templates.get_page_count_for_letter', return_value=1)
|
||||||
|
|
||||||
|
page = client_request.get(
|
||||||
|
'main.view_template',
|
||||||
|
service_id=SERVICE_ONE_ID,
|
||||||
|
template_id=fake_uuid,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert page.select('.hint') == []
|
||||||
|
assert 'personalisation' not in ' '.join(
|
||||||
|
link.text.lower() for link in page.select('a')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_set_template_sender(
|
def test_set_template_sender(
|
||||||
client_request,
|
client_request,
|
||||||
fake_uuid,
|
fake_uuid,
|
||||||
|
|||||||
Reference in New Issue
Block a user