mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 09:19:48 -04:00
Code tidy up as be @imdad comments.
This commit is contained in:
@@ -38,7 +38,7 @@ def persist_notification(
|
|||||||
notification_type,
|
notification_type,
|
||||||
api_key_id,
|
api_key_id,
|
||||||
key_type,
|
key_type,
|
||||||
created_at=None,
|
created_at=datetime.utcnow(),
|
||||||
job_id=None,
|
job_id=None,
|
||||||
job_row_number=None,
|
job_row_number=None,
|
||||||
reference=None,
|
reference=None,
|
||||||
@@ -47,7 +47,6 @@ def persist_notification(
|
|||||||
simulated=False
|
simulated=False
|
||||||
):
|
):
|
||||||
|
|
||||||
notification_created_at = created_at or datetime.utcnow()
|
|
||||||
notification = Notification(
|
notification = Notification(
|
||||||
id=notification_id,
|
id=notification_id,
|
||||||
template_id=template_id,
|
template_id=template_id,
|
||||||
@@ -59,7 +58,7 @@ def persist_notification(
|
|||||||
notification_type=notification_type,
|
notification_type=notification_type,
|
||||||
api_key_id=api_key_id,
|
api_key_id=api_key_id,
|
||||||
key_type=key_type,
|
key_type=key_type,
|
||||||
created_at=notification_created_at,
|
created_at=created_at,
|
||||||
job_id=job_id,
|
job_id=job_id,
|
||||||
job_row_number=job_row_number,
|
job_row_number=job_row_number,
|
||||||
client_reference=client_reference,
|
client_reference=client_reference,
|
||||||
|
|||||||
@@ -67,10 +67,7 @@ def post_notification(notification_type):
|
|||||||
else:
|
else:
|
||||||
current_app.logger.info("POST simulated notification for id: {}".format(notification.id))
|
current_app.logger.info("POST simulated notification for id: {}".format(notification.id))
|
||||||
if notification_type == SMS_TYPE:
|
if notification_type == SMS_TYPE:
|
||||||
sms_sender = (authenticated_service.sms_sender
|
sms_sender = authenticated_service.sms_sender or current_app.config.get('FROM_NUMBER')
|
||||||
if authenticated_service.sms_sender
|
|
||||||
else current_app.config.get('FROM_NUMBER')
|
|
||||||
)
|
|
||||||
resp = create_post_sms_response_from_notification(notification=notification,
|
resp = create_post_sms_response_from_notification(notification=notification,
|
||||||
body=str(template_with_content),
|
body=str(template_with_content),
|
||||||
from_number=sms_sender,
|
from_number=sms_sender,
|
||||||
|
|||||||
Reference in New Issue
Block a user