More changes are done.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-02-20 17:05:34 -05:00
parent 74ac09ae55
commit 4429e48221
2 changed files with 21 additions and 21 deletions

View File

@@ -1652,26 +1652,26 @@ class Notification(db.Model):
@property @property
def formatted_status(self): def formatted_status(self):
return { return {
"email": { NotificationType.EMAIL: {
"failed": "Failed", NotificationStatus.FAILED: "Failed",
"technical-failure": "Technical failure", NotificationStatus.TECHNICAL_FAILURE: "Technical failure",
"temporary-failure": "Inbox not accepting messages right now", NotificationStatus.TEMPORARY_FAILURE: "Inbox not accepting messages right now",
"permanent-failure": "Email address doesnt exist", NotificationStatus.PERMANENT_FAILURE: "Email address doesnt exist",
"delivered": "Delivered", NotificationStatus.DELIVERED: "Delivered",
"sending": "Sending", NotificationStatus.SENDING: "Sending",
"created": "Sending", NotificationStatus.CREATED: "Sending",
"sent": "Delivered", NotificationStatus.SENT: "Delivered",
}, },
"sms": { NotificationType.SMS: {
"failed": "Failed", NotificationStatus.FAILED: "Failed",
"technical-failure": "Technical failure", NotificationStatus.TECHNICAL_FAILURE: "Technical failure",
"temporary-failure": "Unable to find carrier response -- still looking", NotificationStatus.TEMPORARY_FAILURE: "Unable to find carrier response -- still looking",
"permanent-failure": "Unable to find carrier response.", NotificationStatus.PERMANENT_FAILURE: "Unable to find carrier response.",
"delivered": "Delivered", NotificationStatus.DELIVERED: "Delivered",
"pending": "Pending", NotificationStatus.PENDING: "Pending",
"sending": "Sending", NotificationStatus.SENDING: "Sending",
"created": "Sending", NotificationStatus.CREATED: "Sending",
"sent": "Sent internationally", NotificationStatus.SENT: "Sent internationally",
}, },
}[self.template.template_type].get(self.status, self.status) }[self.template.template_type].get(self.status, self.status)

View File

@@ -26,6 +26,6 @@ def get_total_sent_notifications_for_day(day):
sms_count = get_total_sent_notifications_for_day_and_type(day, NotificationType.SMS) sms_count = get_total_sent_notifications_for_day_and_type(day, NotificationType.SMS)
return { return {
"email": email_count, NotificationType.EMAIL: email_count,
"sms": sms_count, NotificationType.SMS: sms_count,
} }