From: Trevor Bramwell Date: Fri, 9 Feb 2018 19:08:55 +0000 (-0800) Subject: Ensure DEBUG is set as a Boolean X-Git-Tag: 2.0.99~222^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=e5fa48646ca278bf997c103873e5fb685248f646;p=laas.git Ensure DEBUG is set as a Boolean Since os.environ only allows strings DEBUG needs to be converted. Assigning DEBUG to the comparison of the strings is enough to get the correct value out. Change-Id: Ie104d2fc5de5906ad2830c5ed7cff3b1c0fda3c5 Signed-off-by: Trevor Bramwell --- diff --git a/src/pharos_dashboard/settings.py b/src/pharos_dashboard/settings.py index fa5879f..361c4a1 100644 --- a/src/pharos_dashboard/settings.py +++ b/src/pharos_dashboard/settings.py @@ -5,7 +5,9 @@ from datetime import timedelta BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = os.environ['DEBUG'] +# NOTE: os.environ only returns strings, so making a comparison to +# 'True' here will convert it to the correct Boolean value. +DEBUG = os.environ['DEBUG'] == 'True' # Application definition