Fix collectstatic in case of theme customization

When doing theme customization with templates
collectstatic failes with a traceback

Change-Id: I0fdb80ddde1f73b657d445c75b55636d6f2e8d88
Closes-bug: #1744239
This commit is contained in:
Radomir Dopieralski 2018-02-07 19:32:42 +01:00
parent a59ee7eca3
commit dc0bce63a0
1 changed files with 5 additions and 3 deletions

View File

@ -15,6 +15,7 @@ from importlib import import_module
import logging
import os
import pkgutil
import re
from horizon.utils import file_discovery
from openstack_dashboard import theme_settings
@ -341,9 +342,10 @@ def find_static_files(
# 'framework/widgets/help-panel/help-panel.html'
# ] = 'themes/material/templates/framework/widgets/\
# help-panel/help-panel.html'
(templates_part, override_path) = theme_file.split('/templates/')
template_overrides[override_path] = 'themes/' + \
theme_name + theme_file
override_path = re.sub(r'^(|.*/)templates/', '', theme_file)
template_overrides[override_path] = os.path.join('themes',
theme_name,
theme_file)
discovered_files['template_overrides'] = template_overrides