mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
For the post_sms_response and post_email_response the reference property is always present but the value can be null.
Added a test for an empty reference. Remove datetime format on the created_at attribute of a notification, it is not needed.
This commit is contained in:
@@ -57,7 +57,7 @@ def persist_notification(template_id,
|
||||
notification_type=notification_type,
|
||||
api_key_id=api_key_id,
|
||||
key_type=key_type,
|
||||
created_at=created_at or datetime.utcnow().strftime(DATETIME_FORMAT),
|
||||
created_at=created_at or datetime.utcnow(),
|
||||
job_id=job_id,
|
||||
job_row_number=job_row_number,
|
||||
client_reference=reference
|
||||
|
||||
@@ -47,7 +47,7 @@ post_sms_response = {
|
||||
"title": "response v2/notifications/sms",
|
||||
"properties": {
|
||||
"id": uuid,
|
||||
"reference": {"type": "string"},
|
||||
"reference": {"type": ["string", "null"]},
|
||||
"content": sms_content,
|
||||
"uri": {"type": "string"},
|
||||
"template": template
|
||||
@@ -90,7 +90,7 @@ post_email_response = {
|
||||
"title": "response v2/notifications/email",
|
||||
"properties": {
|
||||
"id": uuid,
|
||||
"reference": {"type": "string"},
|
||||
"reference": {"type": ["string", "null"]},
|
||||
"content": email_content,
|
||||
"uri": {"type": "string"},
|
||||
"template": template
|
||||
|
||||
@@ -38,7 +38,7 @@ def post_sms_notification():
|
||||
notification_type=SMS_TYPE,
|
||||
api_key_id=api_user.id,
|
||||
key_type=api_user.key_type,
|
||||
reference=form['reference'])
|
||||
reference=form.get('reference'))
|
||||
send_notification_to_queue(notification, service.research_mode)
|
||||
|
||||
resp = create_post_sms_response_from_notification(notification,
|
||||
@@ -65,7 +65,7 @@ def post_email_notification():
|
||||
notification_type=EMAIL_TYPE,
|
||||
api_key_id=api_user.id,
|
||||
key_type=api_user.key_type,
|
||||
reference=form['reference'])
|
||||
reference=form.get('reference'))
|
||||
|
||||
send_notification_to_queue(notification, service.research_mode)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user