Use manifest storage and correct webpack conversion on easymde form

This commit is contained in:
Antoine Bartuccio 2024-10-14 18:24:21 +02:00 committed by Bartuccio Antoine
parent 670d2fa12e
commit dee54c3b41

View File

@ -29,6 +29,7 @@ from captcha.fields import CaptchaField
from django import forms from django import forms
from django.conf import settings from django.conf import settings
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm from django.contrib.auth.forms import AuthenticationForm, UserCreationForm
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.db import transaction from django.db import transaction
from django.forms import ( from django.forms import (
@ -38,7 +39,6 @@ from django.forms import (
Textarea, Textarea,
TextInput, TextInput,
) )
from django.templatetags.static import static
from django.utils.translation import gettext from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from phonenumber_field.widgets import RegionalPhoneNumberWidget from phonenumber_field.widgets import RegionalPhoneNumberWidget
@ -72,8 +72,8 @@ class MarkdownInput(Textarea):
context = super().get_context(name, value, attrs) context = super().get_context(name, value, attrs)
context["statics"] = { context["statics"] = {
"js": static("webpack/easymde-index.js"), "js": staticfiles_storage.url("webpack/easymde-index.ts"),
"css": static("webpack/easymde-index.css"), "css": staticfiles_storage.url("webpack/easymde-index.css"),
} }
return context return context