Allow uploaded letters to be sent if valid

Added a send button which only appears on the page if the query string
indicates that the PDF is valid. Before actually sending, we check that
the service has the right permissions and that the metadata for the
letter confirms the letter is valid (because the query string can be
changed).
This commit is contained in:
Katie Smith
2019-09-09 12:22:52 +01:00
parent 7368245c9a
commit 79053dec93
6 changed files with 138 additions and 1 deletions

View File

@@ -59,6 +59,14 @@ class NotificationApiClient(NotifyAdminAPIClient):
data = _attach_current_user(data)
return self.post(url='/service/{}/send-notification'.format(service_id), data=data)
def send_precompiled_letter(self, service_id, filename, file_id):
data = {
'filename': filename,
'file_id': file_id,
}
data = _attach_current_user(data)
return self.post(url='/service/{}/send-pdf-letter'.format(service_id), data=data)
def get_notification(self, service_id, notification_id):
return self.get(url='/service/{}/notifications/{}'.format(service_id, notification_id))