mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #28242 -- Moved ImageField file extension validation to the form field.
This commit is contained in:
committed by
Tim Graham
parent
6bb3b2bff4
commit
a0c07d77fc
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user