Skip to content

Commit

Permalink
fixup! fix STATIC_ROOT not used for dashboard theme search (Fix #2683,
Browse files Browse the repository at this point in the history
  • Loading branch information
niol committed Aug 24, 2023
1 parent 80e3ff4 commit f85f997
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions webapp/graphite/dashboard/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
import os
import errno

from os.path import getmtime
Expand Down Expand Up @@ -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']
Expand Down
8 changes: 4 additions & 4 deletions webapp/graphite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@
from graphite.app_settings import * # noqa


STATICFILES_DIRS = (
join(WEBAPP_DIR, 'content'),
)

# Handle renamed timeout settings
FIND_TIMEOUT = FIND_TIMEOUT or REMOTE_FIND_TIMEOUT or 3.0
FETCH_TIMEOUT = FETCH_TIMEOUT or REMOTE_FETCH_TIMEOUT or 6.0
Expand Down Expand Up @@ -294,10 +298,6 @@
except ImportError:
pass

STATICFILES_DIRS = (
STATIC_ROOT,
)

if DATABASES is None:
DATABASES = {
'default': {
Expand Down

0 comments on commit f85f997

Please sign in to comment.