Manually add theme path rather than options

This commit is contained in:
Mouse Reeve
2022-03-13 13:11:24 -07:00
parent 753cd36f86
commit 3885ae789b
3 changed files with 8 additions and 26 deletions

View File

@ -1,7 +1,5 @@
""" manage themes """
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.staticfiles.utils import get_files
from django.contrib.staticfiles.storage import StaticFilesStorage
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.utils.decorators import method_decorator
@ -41,11 +39,8 @@ class Themes(View):
def get_view_data():
"""data for view"""
choices = list(get_files(StaticFilesStorage(), location="css/themes"))
current = models.Theme.objects.values_list("path", flat=True)
return {
"themes": models.Theme.objects.all(),
"choices": [c for c in choices if c not in current and c[-5:] == ".scss"],
"theme_form": forms.ThemeForm(),
}