mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Return the scheduled_for datetime in the DATETIME_FORMAT from the post_notification
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from datetime import datetime
|
||||
|
||||
from app import DATETIME_FORMAT
|
||||
from app.models import NOTIFICATION_STATUS_TYPES, TEMPLATE_TYPES
|
||||
from app.schema_validation.definitions import (uuid, personalisation)
|
||||
|
||||
@@ -203,7 +204,8 @@ def create_post_sms_response_from_notification(notification, body, from_number,
|
||||
"template": __create_template_from_notification(notification=notification,
|
||||
url_root=url_root,
|
||||
service_id=service_id),
|
||||
"scheduled_for": scheduled_for
|
||||
"scheduled_for": datetime.strptime(scheduled_for,
|
||||
"%Y-%m-%d %H:%M:%S").strftime(DATETIME_FORMAT) if scheduled_for else None
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +223,8 @@ def create_post_email_response_from_notification(notification, content, subject,
|
||||
"template": __create_template_from_notification(notification=notification,
|
||||
url_root=url_root,
|
||||
service_id=service_id),
|
||||
"scheduled_for": scheduled_for
|
||||
"scheduled_for": datetime.strptime(scheduled_for,
|
||||
"%Y-%m-%d %H:%M:%S").strftime(DATETIME_FORMAT) if scheduled_for else None
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user