mirror of
https://github.com/django/django.git
synced 2025-11-25 13:13:28 +00:00
Fixed #28242 -- Moved ImageField file extension validation to the form field.
This commit is contained in:
parent
6bb3b2bff4
commit
a0c07d77fc
8 changed files with 47 additions and 11 deletions
|
|
@ -192,6 +192,17 @@ try:
|
|||
|
||||
def __str__(self):
|
||||
return self.description
|
||||
|
||||
class NoExtensionImageFile(models.Model):
|
||||
def upload_to(self, filename):
|
||||
return 'tests/no_extension'
|
||||
|
||||
description = models.CharField(max_length=20)
|
||||
image = models.ImageField(storage=temp_storage, upload_to=upload_to)
|
||||
|
||||
def __str__(self):
|
||||
return self.description
|
||||
|
||||
except ImportError:
|
||||
test_images = False
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue