diff options
author | Radomir Dopieralski <openstack@sheep.art.pl> | 2018-02-07 19:32:42 +0100 |
---|---|---|
committer | Saverio Proto <saverio.proto@switch.ch> | 2018-02-11 20:27:15 +0000 |
commit | 3c0b23eaa2ae85b9f199455a52849ca2a2c35f15 (patch) | |
tree | 6ee882b560aa3bf083c7205bb050313393927a54 | |
parent | 56e170b8dcccf46e82ffa2ea2304b1c26be2e6a3 (diff) | |
download | horizon-3c0b23eaa2ae85b9f199455a52849ca2a2c35f15.tar.gz |
Fix collectstatic in case of theme customization
When doing theme customization with templates
collectstatic failes with a traceback
Change-Id: I0fdb80ddde1f73b657d445c75b55636d6f2e8d88
Closes-bug: #1744239
(cherry picked from commit dc0bce63a03e37e9f3f181930ba6d6b7c8b1346e)
-rw-r--r-- | openstack_dashboard/utils/settings.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/openstack_dashboard/utils/settings.py b/openstack_dashboard/utils/settings.py index 65b26c429..0c51bd89a 100644 --- a/openstack_dashboard/utils/settings.py +++ b/openstack_dashboard/utils/settings.py @@ -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 @@ -329,9 +330,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 |