Fixed #29065 -- Made django.core.validators only load Pillow if needed.
This commit is contained in:
parent
d4bbd3f418
commit
46b3e3ffdc
|
@ -510,9 +510,8 @@ def get_available_image_extensions():
|
|||
return [ext.lower()[1:] for ext in Image.EXTENSION]
|
||||
|
||||
|
||||
validate_image_file_extension = FileExtensionValidator(
|
||||
allowed_extensions=get_available_image_extensions(),
|
||||
)
|
||||
def validate_image_file_extension(value):
|
||||
return FileExtensionValidator(allowed_extensions=get_available_image_extensions())(value)
|
||||
|
||||
|
||||
@deconstructible
|
||||
|
|
Loading…
Reference in New Issue