fix: Set defaults if customisation app not loaded

This commit is contained in:
James Graham
2020-06-24 12:01:45 +01:00
parent 0cceb604dd
commit 62d7a1e48c

View File

@@ -376,16 +376,20 @@ else:
# Import customisation app settings if present # Import customisation app settings if present
CUSTOMISATION_NAME = None
TEMPLATE_NAME_INDEX = 'index.html'
TEMPLATE_WELCOME_EMAIL_NAME = 'welcome-email'
try: try:
from custom.settings import (CUSTOMISATION_NAME, TEMPLATE_NAME_INDEX, from custom.settings import (
TEMPLATE_WELCOME_EMAIL_NAME) CUSTOMISATION_NAME,
TEMPLATE_NAME_INDEX,
TEMPLATE_WELCOME_EMAIL_NAME
)
logger.info("Loaded customisation app: %s", CUSTOMISATION_NAME) logger.info("Loaded customisation app: %s", CUSTOMISATION_NAME)
INSTALLED_APPS.append('custom') INSTALLED_APPS.append('custom')
except ImportError as e: except ImportError as exc:
logger.info("No customisation app loaded: %s", e) logger.info("No customisation app loaded: %s", exc)
# Set default values if no customisations loaded
CUSTOMISATION_NAME = None
TEMPLATE_NAME_INDEX = 'index.html'
TEMPLATE_WELCOME_EMAIL_NAME = 'welcome-email'