1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00

fix(appsettings): a theme change reaches the CSS nginx serves

nginx serves STATIC_ROOT (staticfiles/) since collectstatic moved there,
but the theme view wrote only static/css/wvc-main.min.css, so a new theme
showed up only after the next collectstatic. The view now also writes the
collected copy when collectstatic has run; the source copy stays so a
later collectstatic keeps the theme.
This commit is contained in:
catborise 2026-10-12 08:14:00 +03:00
parent 72681ab54e
commit c23521bcf4
2 changed files with 48 additions and 1 deletions

View file

@ -93,6 +93,10 @@ def appsettings(request):
)
with open("static/css/" + main_css, "w") as css:
css.write(css_compressed)
# nginx serves the collected copy; collectstatic later takes it from static/
served = Path(settings.STATIC_ROOT or "", "css")
if settings.STATIC_ROOT and served.is_dir():
(served / main_css).write_text(css_compressed)
bootstrap_theme.value = theme
bootstrap_theme.save()