mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 17:45:32 -04:00
Don't use service default postage, but template postage instead
This commit is contained in:
@@ -390,7 +390,7 @@ def get_job_partials(job, template):
|
|||||||
if notifications['notifications']:
|
if notifications['notifications']:
|
||||||
postage = notifications['notifications'][0]['postage']
|
postage = notifications['notifications'][0]['postage']
|
||||||
else:
|
else:
|
||||||
postage = current_service.postage
|
postage = template['postage']
|
||||||
|
|
||||||
counts = render_template(
|
counts = render_template(
|
||||||
'partials/jobs/count-letters.html',
|
'partials/jobs/count-letters.html',
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
|||||||
'free_sms_fragment_limit',
|
'free_sms_fragment_limit',
|
||||||
'prefix_sms',
|
'prefix_sms',
|
||||||
'contact_link',
|
'contact_link',
|
||||||
'postage',
|
|
||||||
}
|
}
|
||||||
if disallowed_attributes:
|
if disallowed_attributes:
|
||||||
raise TypeError('Not allowed to update service attributes: {}'.format(
|
raise TypeError('Not allowed to update service attributes: {}'.format(
|
||||||
|
|||||||
@@ -22,12 +22,10 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if current_service.has_permission("choose_postage") %}
|
|
||||||
<div class="column-whole" id="postage">
|
<div class="column-whole" id="postage">
|
||||||
<h2 class="heading-small heading-inline">Postage</h2>:
|
<h2 class="heading-small heading-inline">Postage</h2>:
|
||||||
{{ template_postage or current_service.postage }} class
|
{{ template_postage or current_service.postage }} class
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if current_user.has_permissions('send_messages', restrict_admin_usage=True) %}
|
{% if current_user.has_permissions('send_messages', restrict_admin_usage=True) %}
|
||||||
<div class="column-half">
|
<div class="column-half">
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ from tests.conftest import (
|
|||||||
active_caseworking_user,
|
active_caseworking_user,
|
||||||
active_user_with_permissions,
|
active_user_with_permissions,
|
||||||
mock_get_notifications,
|
mock_get_notifications,
|
||||||
|
mock_get_service_letter_template,
|
||||||
normalize_spaces,
|
normalize_spaces,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -553,7 +554,6 @@ def test_should_show_letter_job_with_first_class_if_notifications_are_first_clas
|
|||||||
def test_should_show_letter_job_with_first_class_if_no_notifications(
|
def test_should_show_letter_job_with_first_class_if_no_notifications(
|
||||||
client_request,
|
client_request,
|
||||||
service_one,
|
service_one,
|
||||||
mock_get_service_letter_template,
|
|
||||||
mock_get_job,
|
mock_get_job,
|
||||||
fake_uuid,
|
fake_uuid,
|
||||||
mock_get_notifications_with_no_notifications,
|
mock_get_notifications_with_no_notifications,
|
||||||
@@ -561,7 +561,7 @@ def test_should_show_letter_job_with_first_class_if_no_notifications(
|
|||||||
mocker
|
mocker
|
||||||
):
|
):
|
||||||
|
|
||||||
service_one['postage'] = 'first'
|
mock_get_service_letter_template(mocker, postage="first")
|
||||||
|
|
||||||
page = client_request.get(
|
page = client_request.get(
|
||||||
'main.view_job',
|
'main.view_job',
|
||||||
|
|||||||
Reference in New Issue
Block a user