diff --git a/openedx/core/djangoapps/theming/helpers.py b/openedx/core/djangoapps/theming/helpers.py index 4d1df641808..b88bbdca438 100644 --- a/openedx/core/djangoapps/theming/helpers.py +++ b/openedx/core/djangoapps/theming/helpers.py @@ -268,9 +268,11 @@ def get_themes(themes_dir=None): """ if not is_comprehensive_theming_enabled(): return [] - if themes_dir is None: - themes_dir = get_theme_base_dirs_unchecked() - return get_themes_unchecked(themes_dir, settings.PROJECT_ROOT) + if themes_dir: + themes_dirs = [themes_dir] + else: + themes_dirs = get_theme_base_dirs_unchecked() + return get_themes_unchecked(themes_dirs, settings.PROJECT_ROOT) def get_theme_base_dirs_unchecked(): diff --git a/openedx/core/djangoapps/theming/management/commands/compile_sass.py b/openedx/core/djangoapps/theming/management/commands/compile_sass.py index 0e193fb1017..765ef98aeac 100644 --- a/openedx/core/djangoapps/theming/management/commands/compile_sass.py +++ b/openedx/core/djangoapps/theming/management/commands/compile_sass.py @@ -90,7 +90,7 @@ def parse_arguments(*args, **options): # pylint: disable=unused-argument if theme_dirs: available_themes = {} for theme_dir in theme_dirs: - available_themes.update({t.theme_dir_name: t for t in get_themes([theme_dir])}) + available_themes.update({t.theme_dir_name: t for t in get_themes(theme_dir)}) else: theme_dirs = get_theme_base_dirs() available_themes = {t.theme_dir_name: t for t in get_themes()} diff --git a/openedx/core/djangoapps/theming/tests/test_helpers.py b/openedx/core/djangoapps/theming/tests/test_helpers.py index 955e723df14..95829a16b41 100644 --- a/openedx/core/djangoapps/theming/tests/test_helpers.py +++ b/openedx/core/djangoapps/theming/tests/test_helpers.py @@ -44,6 +44,7 @@ def test_get_themes(self): Theme('red-theme', 'red-theme', get_theme_base_dir('red-theme'), settings.PROJECT_ROOT), Theme('stanford-style', 'stanford-style', get_theme_base_dir('stanford-style'), settings.PROJECT_ROOT), Theme('test-theme', 'test-theme', get_theme_base_dir('test-theme'), settings.PROJECT_ROOT), + Theme('empty-theme', 'empty-theme', get_theme_base_dir('empty-theme'), settings.PROJECT_ROOT), ] actual_themes = get_themes() self.assertCountEqual(expected_themes, actual_themes)