mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
forms: fix file type validation on CachedFileInput
This commit is contained in:
committed by
Raphael Michel
parent
b69ab86458
commit
3129253eef
@@ -219,8 +219,10 @@ class ExtValidationMixin:
|
||||
|
||||
def clean(self, *args, **kwargs):
|
||||
data = super().clean(*args, **kwargs)
|
||||
if isinstance(data, UploadedFile):
|
||||
filename = data.name
|
||||
|
||||
from ...base.models import CachedFile
|
||||
if isinstance(data, (UploadedFile, CachedFile)):
|
||||
filename = data.name if isinstance(data, UploadedFile) else data.filename
|
||||
ext = os.path.splitext(filename)[1]
|
||||
ext = ext.lower()
|
||||
if ext not in self.ext_whitelist:
|
||||
|
||||
Reference in New Issue
Block a user