mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 08:28:15 -04:00
Make permanent failure status more human
Replace with ‘Phone number doesn’t exist’ or ‘Email address doesn’t’ exist.
This commit is contained in:
@@ -229,15 +229,25 @@ def valid_phone_number(phone_number):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def format_notification_status(status):
|
def format_notification_status(status, template_type):
|
||||||
m = {'failed': 'Failed',
|
return {
|
||||||
'technical-failure': 'Technical failure',
|
'email': {
|
||||||
'temporary-failure': 'Temporarily failed',
|
'failed': 'Failed',
|
||||||
'permanent-failure': 'Permanently failed',
|
'technical-failure': 'Technical failure',
|
||||||
'delivered': 'Delivered',
|
'temporary-failure': 'Temporary failure',
|
||||||
'sending': 'Sending'
|
'permanent-failure': 'Email address does not exist',
|
||||||
}
|
'delivered': 'Delivered',
|
||||||
return m.get(status, status)
|
'sending': 'Sending'
|
||||||
|
},
|
||||||
|
'sms': {
|
||||||
|
'failed': 'Failed',
|
||||||
|
'technical-failure': 'Technical failure',
|
||||||
|
'temporary-failure': 'Temporary failure',
|
||||||
|
'permanent-failure': 'Phone number does not exist',
|
||||||
|
'delivered': 'Delivered',
|
||||||
|
'sending': 'Sending'
|
||||||
|
}
|
||||||
|
}.get(template_type).get(status, status)
|
||||||
|
|
||||||
|
|
||||||
@login_manager.user_loader
|
@login_manager.user_loader
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
caption="Recent activity",
|
caption="Recent activity",
|
||||||
caption_visible=False,
|
caption_visible=False,
|
||||||
empty_message='No messages found',
|
empty_message='No messages found',
|
||||||
field_headings=['Recipient', 'Status', 'Started'],
|
field_headings=['Recipient', 'Error', 'Status', 'Started'],
|
||||||
field_headings_visible=False
|
field_headings_visible=False
|
||||||
) %}
|
) %}
|
||||||
|
|
||||||
@@ -56,19 +56,22 @@
|
|||||||
</p>
|
</p>
|
||||||
<p class="hint">
|
<p class="hint">
|
||||||
{% if item.job %}
|
{% if item.job %}
|
||||||
From <a href="{{ url_for(".view_job", service_id=current_service.id, job_id=item.job.id) }}">{{ item.job.original_file_name }}</a>
|
From <a class="truncated" href="{{ url_for(".view_job", service_id=current_service.id, job_id=item.job.id) }}">{{ item.job.original_file_name }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{{ url_for('.view_template_version', service_id=current_service.id, template_id=item.template.id, version=item.template_version) }}">{{ item.template.name }}</a>
|
<a class="truncated" href="{{ url_for('.view_template_version', service_id=current_service.id, template_id=item.template.id, version=item.template_version) }}">{{ item.template.name }}</a>
|
||||||
from an API call
|
from an API call
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
|
|
||||||
{{ text_field(item.status|format_notification_status) }}
|
{{ date_field(
|
||||||
|
(item.updated_at or item.created_at)|format_datetime_short
|
||||||
|
) }}
|
||||||
|
|
||||||
{% call field(align='right') %}
|
{% call field(status='', align='right') %}
|
||||||
{{ (item.updated_at or item.created_at)|format_datetime_short }}
|
{{ item.status|format_notification_status(item.template.template_type) }}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
|
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
|
|
||||||
{{ previous_next_navigation(prev_page, next_page) }}
|
{{ previous_next_navigation(prev_page, next_page) }}
|
||||||
|
|||||||
Reference in New Issue
Block a user