Manually add theme path rather than options
This commit is contained in:
@ -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(),
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user