mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
clean flake8 except provider code
This commit is contained in:
@@ -45,7 +45,9 @@ def sns_notification_handler(data, headers):
|
||||
try:
|
||||
validate_sns_cert(message)
|
||||
except Exception as e:
|
||||
current_app.logger.error(f"SES-SNS callback failed: validation failed with error: Signature validation failed with error {e}")
|
||||
current_app.logger.error(
|
||||
f"SES-SNS callback failed: validation failed with error: Signature validation failed with error {e}"
|
||||
)
|
||||
raise InvalidRequest("SES-SNS callback failed: validation failed", 400)
|
||||
|
||||
if message.get('Type') == 'SubscriptionConfirmation':
|
||||
@@ -55,12 +57,18 @@ def sns_notification_handler(data, headers):
|
||||
try:
|
||||
response.raise_for_status()
|
||||
except Exception as e:
|
||||
current_app.logger.warning(f"Attempt to raise_for_status()SubscriptionConfirmation Type message files for response: {response.text} with error {e}")
|
||||
raise InvalidRequest("SES-SNS callback failed: attempt to raise_for_status()SubscriptionConfirmation Type message failed", 400)
|
||||
current_app.logger.warning(
|
||||
f"Attempt to raise_for_status()SubscriptionConfirmation Type \
|
||||
message files for response: {response.text} with error {e}"
|
||||
)
|
||||
raise InvalidRequest(
|
||||
"SES-SNS callback failed: attempt to raise_for_status()SubscriptionConfirmation \
|
||||
Type message failed", 400
|
||||
)
|
||||
current_app.logger.info("SES-SNS auto-confirm subscription callback succeeded")
|
||||
return message
|
||||
|
||||
# TODO remove after smoke testing on prod is implemented
|
||||
current_app.logger.info(f"SNS message: {message} is a valid message. Attempting to process it now.")
|
||||
|
||||
|
||||
return message
|
||||
|
||||
Reference in New Issue
Block a user