mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
big commit with letters removal
This commit is contained in:
@@ -202,7 +202,6 @@ def format_notification_type(notification_type):
|
||||
return {
|
||||
'email': 'Email',
|
||||
'sms': 'Text message',
|
||||
'letter': 'Letter'
|
||||
}[notification_type]
|
||||
|
||||
|
||||
@@ -229,23 +228,6 @@ def format_notification_status(status, template_type):
|
||||
'pending': 'Sending',
|
||||
'sent': 'Sent to an international number'
|
||||
},
|
||||
'letter': {
|
||||
'failed': '',
|
||||
'technical-failure': 'Technical failure',
|
||||
'temporary-failure': '',
|
||||
'permanent-failure': 'Permanent failure',
|
||||
'delivered': '',
|
||||
'received': '',
|
||||
'accepted': '',
|
||||
'sending': '',
|
||||
'created': '',
|
||||
'sent': '',
|
||||
'pending-virus-check': '',
|
||||
'virus-scan-failed': 'Virus detected',
|
||||
'returned-letter': '',
|
||||
'cancelled': '',
|
||||
'validation-failed': 'Validation failed',
|
||||
}
|
||||
}[template_type].get(status, status)
|
||||
|
||||
|
||||
@@ -256,23 +238,7 @@ def format_notification_status_as_time(status, created, updated):
|
||||
|
||||
|
||||
def format_notification_status_as_field_status(status, notification_type):
|
||||
return {
|
||||
'letter': {
|
||||
'failed': 'error',
|
||||
'technical-failure': 'error',
|
||||
'temporary-failure': 'error',
|
||||
'permanent-failure': 'error',
|
||||
'delivered': None,
|
||||
'sent': None,
|
||||
'sending': None,
|
||||
'created': None,
|
||||
'accepted': None,
|
||||
'pending-virus-check': None,
|
||||
'virus-scan-failed': 'error',
|
||||
'returned-letter': None,
|
||||
'cancelled': 'error',
|
||||
},
|
||||
}.get(
|
||||
return {}.get(
|
||||
notification_type,
|
||||
{
|
||||
'failed': 'error',
|
||||
@@ -314,6 +280,7 @@ def nl2br(value):
|
||||
|
||||
|
||||
# this formatter appears to only be used in the letter module
|
||||
# TODO: use more widely, or delete? currency symbol could be set in config
|
||||
def format_number_in_pounds_as_currency(number):
|
||||
if number >= 1:
|
||||
return f"£{number:,.2f}"
|
||||
@@ -455,12 +422,6 @@ def message_count_noun(count, template_type):
|
||||
else:
|
||||
return 'emails'
|
||||
|
||||
elif template_type == 'letter':
|
||||
if count == 1:
|
||||
return 'letter'
|
||||
else:
|
||||
return 'letters'
|
||||
|
||||
|
||||
def message_count(count, template_type):
|
||||
return (
|
||||
@@ -489,12 +450,6 @@ def recipient_count_label(count, template_type):
|
||||
else:
|
||||
return 'email addresses'
|
||||
|
||||
elif template_type == 'letter':
|
||||
if count == 1:
|
||||
return 'address'
|
||||
else:
|
||||
return 'addresses'
|
||||
|
||||
|
||||
def recipient_count(count, template_type):
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user