summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Anderson <cmawebsite@gmail.com>2018-01-30 09:42:23 -0500
committerTim Graham <timograham@gmail.com>2018-01-30 09:42:23 -0500
commit46b3e3ffdc25b5a42762df20e536401fc512c5f3 (patch)
treee1337424e105a30bc60f09eadaefe1f52020e794
parentd4bbd3f41882104156cf9f2b02cb13376a59489d (diff)
Fixed #29065 -- Made django.core.validators only load Pillow if needed.
-rw-r--r--django/core/validators.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/core/validators.py b/django/core/validators.py
index 3e39b9db93..965f35cbab 100644
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -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