Skip to content

Commit

Permalink
fix for tailwind_config mgmt cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Nov 14, 2024
1 parent 89cde80 commit 282d37b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/argus_htmx/management/commands/tailwind_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.template.context import make_context
from django.template.loader import get_template

from argus_htmx.themes.utils import get_themes
from argus_htmx.themes.utils import get_raw_themes_setting
from argus_htmx import settings as argus_htmx_settings


Expand Down Expand Up @@ -78,7 +78,7 @@ def get_context(self, target_dir: pathlib.Path):
argus_htmx_settings.TAILWIND_THEME_OVERRIDE,
),
"daisyuithemes": textwrap.indent(
json.dumps(get_themes(), indent=2),
json.dumps(get_raw_themes_setting(), indent=2),
prefix=10 * " ",
predicate=lambda line: line != "[\n", # this is kinda hacky, but eh
),
Expand Down
7 changes: 6 additions & 1 deletion src/argus_htmx/themes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


__all__ = [
"get_raw_themes_setting",
"get_theme_names",
"get_theme_default",
]
Expand All @@ -18,8 +19,12 @@
LOG = logging.getLogger(__name__)


def get_raw_themes_setting():
return getattr(settings, "DAISYUI_THEMES", fallbacks.DAISYUI_THEMES)


def get_themes_from_setting():
themes_setting = getattr(settings, "DAISYUI_THEMES", fallbacks.DAISYUI_THEMES)
themes_setting = get_raw_themes_setting()
theme_names = []
for theme in themes_setting:
if isinstance(theme, str):
Expand Down

0 comments on commit 282d37b

Please sign in to comment.