summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorManatsawin Hanmongkolchai <manatsawin+git@gmail.com>2017-05-28 14:05:21 +0700
committerTim Graham <timograham@gmail.com>2017-06-01 10:13:23 -0400
commita0c07d77fc313388c72a17cd59411265069f037f (patch)
tree6ca6565eb41de7db58122fe41cc853667ee83a76 /django/forms
parent6bb3b2bff4bca24896023758a720f16fa6b1e2bb (diff)
Fixed #28242 -- Moved ImageField file extension validation to the form field.
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/fields.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py
index a4132d8f33..d665606745 100644
--- a/django/forms/fields.py
+++ b/django/forms/fields.py
@@ -591,6 +591,7 @@ class FileField(Field):
class ImageField(FileField):
+ default_validators = [validators.validate_image_file_extension]
default_error_messages = {
'invalid_image': _(
"Upload a valid image. The file you uploaded was either not an "