Add a platform admin page to submit returned letter references

A platform admin form accepts a list of references (one per line)
received from DVLA and sends them to the API to update notification
statuses.

References we get from DVLA start with `NOTIFY00\d`, which isn't
part of the reference we store in the database, so we remove them
before sending the data to the API.

The new `returned-letter` status should be treated as `delivered`
for now until we decide a way to display returned letters to users.
This commit is contained in:
Alexey Bezhan
2018-09-06 16:34:23 +01:00
parent afe6d04d96
commit b75681dfbc
11 changed files with 124 additions and 8 deletions

View File

@@ -385,6 +385,7 @@ def format_notification_status(status, template_type):
'sent': 'Delivered',
'pending-virus-check': 'Pending virus check',
'virus-scan-failed': 'Virus detected',
'returned-letter': 'Delivered',
}
}[template_type].get(status, status)
@@ -410,6 +411,7 @@ def format_notification_status_as_field_status(status, notification_type):
'accepted': None,
'pending-virus-check': None,
'virus-scan-failed': 'error',
'returned-letter': None,
}
}.get(
notification_type,