mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 10:42:41 -05:00
reformat up to latest version of black
This commit is contained in:
@@ -233,12 +233,16 @@ def _set_up_data_for_status_update(callback_api, notification):
|
||||
"notification_to": notification.to,
|
||||
"notification_status": notification.status,
|
||||
"notification_created_at": notification.created_at.strftime(DATETIME_FORMAT),
|
||||
"notification_updated_at": notification.updated_at.strftime(DATETIME_FORMAT)
|
||||
if notification.updated_at
|
||||
else None,
|
||||
"notification_sent_at": notification.sent_at.strftime(DATETIME_FORMAT)
|
||||
if notification.sent_at
|
||||
else None,
|
||||
"notification_updated_at": (
|
||||
notification.updated_at.strftime(DATETIME_FORMAT)
|
||||
if notification.updated_at
|
||||
else None
|
||||
),
|
||||
"notification_sent_at": (
|
||||
notification.sent_at.strftime(DATETIME_FORMAT)
|
||||
if notification.sent_at
|
||||
else None
|
||||
),
|
||||
"notification_type": notification.notification_type,
|
||||
"service_callback_api_url": callback_api.url,
|
||||
"service_callback_api_bearer_token": callback_api.bearer_token,
|
||||
|
||||
@@ -136,12 +136,14 @@ def create_service(
|
||||
message_limit=message_limit,
|
||||
total_message_limit=total_message_limit,
|
||||
restricted=restricted,
|
||||
email_from=email_from
|
||||
if email_from
|
||||
else service_name.lower().replace(" ", "."),
|
||||
created_by=user
|
||||
if user
|
||||
else create_user(email="{}@test.gsa.gov".format(uuid.uuid4())),
|
||||
email_from=(
|
||||
email_from if email_from else service_name.lower().replace(" ", ".")
|
||||
),
|
||||
created_by=(
|
||||
user
|
||||
if user
|
||||
else create_user(email="{}@test.gsa.gov".format(uuid.uuid4()))
|
||||
),
|
||||
prefix_sms=prefix_sms,
|
||||
organization_type=organization_type,
|
||||
organization=organization,
|
||||
|
||||
@@ -1271,10 +1271,10 @@ def test_post_notifications_saves_email_or_sms_to_queue(
|
||||
"template_id": template.id,
|
||||
"personalisation": {"message": "Dear citizen, have a nice day"},
|
||||
}
|
||||
data.update(
|
||||
{"email_address": "joe.citizen@example.com"}
|
||||
) if notification_type == NotificationType.EMAIL else data.update(
|
||||
{"phone_number": "+447700900855"}
|
||||
(
|
||||
data.update({"email_address": "joe.citizen@example.com"})
|
||||
if notification_type == NotificationType.EMAIL
|
||||
else data.update({"phone_number": "+447700900855"})
|
||||
)
|
||||
|
||||
response = client.post(
|
||||
@@ -1340,10 +1340,10 @@ def test_post_notifications_saves_email_or_sms_normally_if_saving_to_queue_fails
|
||||
"template_id": template.id,
|
||||
"personalisation": {"message": "Dear citizen, have a nice day"},
|
||||
}
|
||||
data.update(
|
||||
{"email_address": "joe.citizen@example.com"}
|
||||
) if notification_type == NotificationType.EMAIL else data.update(
|
||||
{"phone_number": "+447700900855"}
|
||||
(
|
||||
data.update({"email_address": "joe.citizen@example.com"})
|
||||
if notification_type == NotificationType.EMAIL
|
||||
else data.update({"phone_number": "+447700900855"})
|
||||
)
|
||||
|
||||
response = client.post(
|
||||
@@ -1402,10 +1402,10 @@ def test_post_notifications_doesnt_use_save_queue_for_test_notifications(
|
||||
"template_id": template.id,
|
||||
"personalisation": {"message": "Dear citizen, have a nice day"},
|
||||
}
|
||||
data.update(
|
||||
{"email_address": "joe.citizen@example.com"}
|
||||
) if notification_type == NotificationType.EMAIL else data.update(
|
||||
{"phone_number": "+447700900855"}
|
||||
(
|
||||
data.update({"email_address": "joe.citizen@example.com"})
|
||||
if notification_type == NotificationType.EMAIL
|
||||
else data.update({"phone_number": "+447700900855"})
|
||||
)
|
||||
response = client.post(
|
||||
path=f"/v2/notifications/{notification_type}",
|
||||
|
||||
Reference in New Issue
Block a user