Remove the use of schedule_for in post_notifications.

Years ago we started to implement a way to schedule a notification. We hit a problem but we never came up with a good solution and the feature never made it back to the top of the priority list.

This PR removes the code for scheduled_for. There will be another PR to drop the scheduled_notifications table and remove the schedule_notifications service permission

Unfortunately, I don't think we can remove the `scheduled_for` attribute from the notification.serialized method because out clients might fail if something is missing. For now I have left it in but defaulted the value to None.
This commit is contained in:
Rebecca Law
2020-06-24 07:34:58 +01:00
parent d108c644bc
commit ce32e577b7
12 changed files with 34 additions and 178 deletions

View File

@@ -2,10 +2,10 @@
def create_post_sms_response_from_notification(
notification_id, client_reference, template_id, template_version, service_id,
content, from_number, url_root, scheduled_for
content, from_number, url_root
):
resp = __create_notification_response(
notification_id, client_reference, template_id, template_version, service_id, url_root, scheduled_for
notification_id, client_reference, template_id, template_version, service_id, url_root
)
resp['content'] = {
'from_number': from_number,
@@ -24,10 +24,9 @@ def create_post_email_response_from_notification(
subject,
email_from,
url_root,
scheduled_for
):
resp = __create_notification_response(
notification_id, client_reference, template_id, template_version, service_id, url_root, scheduled_for
notification_id, client_reference, template_id, template_version, service_id, url_root
)
resp['content'] = {
"from_email": email_from,
@@ -39,10 +38,10 @@ def create_post_email_response_from_notification(
def create_post_letter_response_from_notification(
notification_id, client_reference, template_id, template_version, service_id,
content, subject, url_root, scheduled_for
content, subject, url_root
):
resp = __create_notification_response(
notification_id, client_reference, template_id, template_version, service_id, url_root, scheduled_for
notification_id, client_reference, template_id, template_version, service_id, url_root
)
resp['content'] = {
"body": content,
@@ -52,7 +51,7 @@ def create_post_letter_response_from_notification(
def __create_notification_response(
notification_id, client_reference, template_id, template_version, service_id, url_root, scheduled_for
notification_id, client_reference, template_id, template_version, service_id, url_root
):
return {
"id": notification_id,
@@ -67,5 +66,5 @@ def __create_notification_response(
str(template_id)
)
},
"scheduled_for": scheduled_for if scheduled_for else None
"scheduled_for": None
}