1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
From: Alexandre Rossi <alexandre.rossi@gmail.com>
Subject: fix STATIC_ROOT not used for dashboard theme search (Fix #2683, #1702)
Forwarded: https://github.com/graphite-project/graphite-web/pull/2816
--- a/webapp/graphite/dashboard/views.py
+++ b/webapp/graphite/dashboard/views.py
@@ -1,4 +1,5 @@
import re
+import os
import errno
from os.path import getmtime
@@ -126,6 +127,10 @@ def dashboard(request, name=None):
debug = request.GET.get('debug', False)
theme = request.GET.get('theme', config.ui_config['theme'])
css_file = finders.find('css/dashboard-%s.css' % theme)
+ if css_file is None:
+ # Also search in STATIC_ROOT for dist packages
+ css_file = os.path.isfile(os.path.join(settings.STATIC_ROOT,
+ 'css/dashboard-%s.css' % theme))
if css_file is None:
initialError = "Invalid theme '%s'" % theme
theme = config.ui_config['theme']
|