Allow SVG club logos
ImageField validates uploads through Pillow, which can't read SVGs, so a club crest that's a vector logo was rejected outright. Switches to a plain FileField with an extension allowlist (png/jpg/jpeg/gif/webp/svg) instead, and restricts the file picker to image types via the widget's accept attribute.
This commit is contained in:
@@ -21,6 +21,7 @@ class ClubForm(forms.ModelForm):
|
||||
widgets = {
|
||||
"primary_color": forms.TextInput(attrs={"placeholder": "#1e40af"}),
|
||||
"secondary_color": forms.TextInput(attrs={"placeholder": "#be185d"}),
|
||||
"logo": forms.ClearableFileInput(attrs={"accept": "image/png,image/jpeg,image/gif,image/webp,image/svg+xml"}),
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user