1
0
Fork 0

Merge branch 'main' into question_invite_correct

This commit is contained in:
Corentin Feys 2022-03-13 23:44:20 +01:00 committed by GitHub
commit 771fa5a00a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 716 additions and 489 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(),
}