Fixed #29065 -- Made django.core.validators only load Pillow if needed.

This commit is contained in:
Collin Anderson 2018-01-30 09:42:23 -05:00 committed by Tim Graham
parent d4bbd3f418
commit 46b3e3ffdc
1 changed files with 2 additions and 3 deletions

View File

@ -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