mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Merge pull request #1599 from GSA/admin-1587_Logging_stuff
admin-1587: Adding some logging that hopefully might shed some light on things.
This commit is contained in:
@@ -233,6 +233,24 @@ def create_app(application):
|
||||
)
|
||||
logging.init_app(application)
|
||||
|
||||
# Hopefully will help identify if there is a race condition causing the CSRF errors
|
||||
# that we have occasionally seen in our environments.
|
||||
for key in ("SECRET_KEY", "DANGEROUS_SALT"):
|
||||
try:
|
||||
value = application.config[key]
|
||||
except KeyError:
|
||||
application.logger.error(f"Env Var {key} doesn't exist.")
|
||||
else:
|
||||
try:
|
||||
data_len = len(value.strip())
|
||||
except (TypeError, AttributeError):
|
||||
application.logger.error(f"Env Var {key} invalid type: {type(value)}")
|
||||
else:
|
||||
if data_len:
|
||||
application.logger.info(f"Env Var {key} is a non-zero length.")
|
||||
else:
|
||||
application.logger.error(f"Env Var {key} is empty.")
|
||||
|
||||
login_manager.login_view = "main.sign_in"
|
||||
login_manager.login_message_category = "default"
|
||||
login_manager.session_protection = None
|
||||
|
||||
Reference in New Issue
Block a user