Reformat code with automated tools

Apply standardized code style
This commit is contained in:
medmunds
2023-02-06 12:27:43 -08:00
committed by Mike Edmunds
parent 40891fcb4a
commit b4e22c63b3
94 changed files with 12936 additions and 7443 deletions

View File

@@ -13,17 +13,23 @@ def check_deprecated_settings(app_configs, **kwargs):
# anymail.E001: rename WEBHOOK_AUTHORIZATION to WEBHOOK_SECRET
if "WEBHOOK_AUTHORIZATION" in anymail_settings:
errors.append(checks.Error(
"The ANYMAIL setting 'WEBHOOK_AUTHORIZATION' has been renamed 'WEBHOOK_SECRET' to improve security.",
hint="You must update your settings.py.",
id="anymail.E001",
))
errors.append(
checks.Error(
"The ANYMAIL setting 'WEBHOOK_AUTHORIZATION' has been renamed"
" 'WEBHOOK_SECRET' to improve security.",
hint="You must update your settings.py.",
id="anymail.E001",
)
)
if hasattr(settings, "ANYMAIL_WEBHOOK_AUTHORIZATION"):
errors.append(checks.Error(
"The ANYMAIL_WEBHOOK_AUTHORIZATION setting has been renamed ANYMAIL_WEBHOOK_SECRET to improve security.",
hint="You must update your settings.py.",
id="anymail.E001",
))
errors.append(
checks.Error(
"The ANYMAIL_WEBHOOK_AUTHORIZATION setting has been renamed"
" ANYMAIL_WEBHOOK_SECRET to improve security.",
hint="You must update your settings.py.",
id="anymail.E001",
)
)
return errors
@@ -33,11 +39,13 @@ def check_insecure_settings(app_configs, **kwargs):
# anymail.W002: DEBUG_API_REQUESTS can leak private information
if get_anymail_setting("debug_api_requests", default=False) and not settings.DEBUG:
errors.append(checks.Warning(
"You have enabled the ANYMAIL setting DEBUG_API_REQUESTS, which can "
"leak API keys and other sensitive data into logs or the console.",
hint="You should not use DEBUG_API_REQUESTS in production deployment.",
id="anymail.W002",
))
errors.append(
checks.Warning(
"You have enabled the ANYMAIL setting DEBUG_API_REQUESTS, which can "
"leak API keys and other sensitive data into logs or the console.",
hint="You should not use DEBUG_API_REQUESTS in production deployment.",
id="anymail.W002",
)
)
return errors