diff options
| author | Manatsawin Hanmongkolchai <manatsawin+git@gmail.com> | 2017-05-28 14:05:21 +0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-06-01 10:44:47 -0400 |
| commit | 110bd820380e06fc8572f94b36bba6fc9d057a6b (patch) | |
| tree | f76f09265ce2a5883826ad7e4c1719849c74451c /django/forms/fields.py | |
| parent | af9a81aa7f14ae1a9fd1f25676f526a43f0c65f3 (diff) | |
[1.11.x] Fixed #28242 -- Moved ImageField file extension validation to the form field.
Backport of a0c07d77fc313388c72a17cd59411265069f037f from master
Diffstat (limited to 'django/forms/fields.py')
| -rw-r--r-- | django/forms/fields.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index 168ea9673c..33ed2882a3 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -610,6 +610,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 " |
