Refs #26367 -- Removed obsolete _size cache on FieldField.
The _size attribute is used in File.size but FieldFile overrides it.
This commit is contained in:
parent
28bcff82c5
commit
f15f4b8bb6
|
@ -87,9 +87,6 @@ class FieldFile(File):
|
||||||
name = self.field.generate_filename(self.instance, name)
|
name = self.field.generate_filename(self.instance, name)
|
||||||
self.name = self.storage.save(name, content, max_length=self.field.max_length)
|
self.name = self.storage.save(name, content, max_length=self.field.max_length)
|
||||||
setattr(self.instance, self.field.name, self.name)
|
setattr(self.instance, self.field.name, self.name)
|
||||||
|
|
||||||
# Update the filesize cache
|
|
||||||
self._size = content.size
|
|
||||||
self._committed = True
|
self._committed = True
|
||||||
|
|
||||||
# Save the object because it has changed, unless save is False
|
# Save the object because it has changed, unless save is False
|
||||||
|
@ -110,10 +107,6 @@ class FieldFile(File):
|
||||||
|
|
||||||
self.name = None
|
self.name = None
|
||||||
setattr(self.instance, self.field.name, self.name)
|
setattr(self.instance, self.field.name, self.name)
|
||||||
|
|
||||||
# Delete the filesize cache
|
|
||||||
if hasattr(self, '_size'):
|
|
||||||
del self._size
|
|
||||||
self._committed = False
|
self._committed = False
|
||||||
|
|
||||||
if save:
|
if save:
|
||||||
|
|
Loading…
Reference in New Issue