Format letter statuses so they make more sense to our users

This commit is contained in:
Pea Tyczynska
2019-01-07 15:17:09 +00:00
parent 36656fd6ba
commit b8318c491b
2 changed files with 16 additions and 5 deletions

View File

@@ -78,8 +78,12 @@ class NotificationApiClient(NotifyAdminAPIClient):
@staticmethod
def map_letters_to_accepted(notifications):
for notification in notifications['notifications']:
if notification['notification_type'] == 'letter' and notification['status'] in ('created', 'sending'):
notification['status'] = 'accepted'
if notification['notification_type'] == 'letter':
if notification['status'] in ('created', 'sending'):
notification['status'] = 'accepted'
if notification['status'] in ('delivered', 'returned-letter'):
notification['status'] = 'received'
return notifications
def get_notification_letter_preview(self, service_id, notification_id, file_type, page=None):