Skip to content

Commit

Permalink
Merge pull request #2816 from niol/master
Browse files Browse the repository at this point in the history
fix STATIC_ROOT not used for dashboard theme search (Fix #2683, #1702)
  • Loading branch information
deniszh authored Aug 25, 2023
2 parents 7518942 + f85f997 commit e058266
Showing 1 changed file with 5 additions and 0 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

0 comments on commit e058266

Please sign in to comment.