Log warning/traceback when failing to include a configured view

This commit is contained in:
Lance Edgar 2022-03-07 17:12:06 -06:00
parent e38cfda076
commit 8f4b223125

View file

@ -31,6 +31,7 @@ import datetime
import six import six
import pytz import pytz
import humanize import humanize
import logging
from rattail.time import timezone, make_utc from rattail.time import timezone, make_utc
from rattail.files import resource_path from rattail.files import resource_path
@ -41,6 +42,9 @@ from pyramid.interfaces import IRoutesMapper
from webhelpers2.html import HTML, tags from webhelpers2.html import HTML, tags
log = logging.getLogger(__name__)
def get_csrf_token(request): def get_csrf_token(request):
""" """
Convenience function to retrieve the effective CSRF token for the given Convenience function to retrieve the effective CSRF token for the given
@ -269,6 +273,9 @@ def include_configured_views(pyramid_config):
for setting in settings: for setting in settings:
if setting.value: if setting.value:
pyramid_config.include(setting.value) try:
pyramid_config.include(setting.value)
except:
log.warning("pyramid failed to include: %s", exc_info=True)
session.close() session.close()