aboutsummaryrefslogtreecommitdiffstats
path: root/lib/toaster/toastermain
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-10-17 10:45:48 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-27 07:23:21 +0000
commitf9cf4739fc85c9760ce748323dc7c8de3fa7eaec (patch)
treee39bb8c8873a318a1f0259ef569eb2c1ca830143 /lib/toaster/toastermain
parentef69be31d133696bde54605f5a18da660099734c (diff)
downloadbitbake-contrib-f9cf4739fc85c9760ce748323dc7c8de3fa7eaec.tar.gz
toaster: Add BUILD_MODE flag to context
We set a TOASTER_MANAGED env variable in the startup script, which has a value of "1" if Toaster should run in build mode. Add a BUILD_MODE variable to settings.py which is True if TOASTER_MANAGED is set to "1", False otherwise. Add this to the context for every template, so we can use this information to conditionally alter the content of pages according to the mode we're in. [YOCTO #8514] Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster/toastermain')
-rw-r--r--lib/toaster/toastermain/settings.py6
-rw-r--r--lib/toaster/toastermain/urls.py2
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/toaster/toastermain/settings.py b/lib/toaster/toastermain/settings.py
index 6439d68c3..b28ddb2b0 100644
--- a/lib/toaster/toastermain/settings.py
+++ b/lib/toaster/toastermain/settings.py
@@ -92,11 +92,9 @@ if 'DATABASE_URL' in os.environ:
else:
raise Exception("FIXME: Please implement missing database url schema for url: %s" % dburl)
-
+BUILD_MODE = False
if 'TOASTER_MANAGED' in os.environ and os.environ['TOASTER_MANAGED'] == "1":
- MANAGED = True
-else:
- MANAGED = False
+ BUILD_MODE = True
# Allows current database settings to be exported as a DATABASE_URL environment variable value
diff --git a/lib/toaster/toastermain/urls.py b/lib/toaster/toastermain/urls.py
index 521588a6a..6c4a953b4 100644
--- a/lib/toaster/toastermain/urls.py
+++ b/lib/toaster/toastermain/urls.py
@@ -60,7 +60,7 @@ if toastermain.settings.DEBUG_PANEL_ENABLED:
#logger.info("Enabled django_toolbar extension")
-if toastermain.settings.MANAGED:
+if toastermain.settings.BUILD_MODE:
urlpatterns = [
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),