From 62d7a1e48c2f3202685ecf95ced3c8cb1a7a3147 Mon Sep 17 00:00:00 2001 From: James Graham Date: Wed, 24 Jun 2020 12:01:45 +0100 Subject: [PATCH] fix: Set defaults if customisation app not loaded --- breccia_mapper/settings.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/breccia_mapper/settings.py b/breccia_mapper/settings.py index e536c0f..d2424c7 100644 --- a/breccia_mapper/settings.py +++ b/breccia_mapper/settings.py @@ -376,16 +376,20 @@ else: # Import customisation app settings if present -CUSTOMISATION_NAME = None -TEMPLATE_NAME_INDEX = 'index.html' -TEMPLATE_WELCOME_EMAIL_NAME = 'welcome-email' - try: - from custom.settings import (CUSTOMISATION_NAME, TEMPLATE_NAME_INDEX, - TEMPLATE_WELCOME_EMAIL_NAME) + from custom.settings import ( + CUSTOMISATION_NAME, + TEMPLATE_NAME_INDEX, + TEMPLATE_WELCOME_EMAIL_NAME + ) logger.info("Loaded customisation app: %s", CUSTOMISATION_NAME) INSTALLED_APPS.append('custom') -except ImportError as e: - logger.info("No customisation app loaded: %s", e) +except ImportError as exc: + 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'