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