mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Remove unnecessary seek operation
file.open does this already.
This commit is contained in:
parent
8ca7cc72d5
commit
0ab0ecc78f
@ -141,7 +141,6 @@ class AbstractDocument(CollectionMember, index.Indexed, models.Model):
|
|||||||
self.file_size = self.file.size
|
self.file_size = self.file.size
|
||||||
|
|
||||||
# Set new document file hash
|
# Set new document file hash
|
||||||
self.file.seek(0)
|
|
||||||
self._set_file_hash(self.file.read())
|
self._set_file_hash(self.file.read())
|
||||||
self.file.seek(0)
|
self.file.seek(0)
|
||||||
|
|
||||||
|
@ -243,7 +243,6 @@ class AbstractImage(ImageFileMixin, CollectionMember, index.Indexed, models.Mode
|
|||||||
self.file_size = self.file.size
|
self.file_size = self.file.size
|
||||||
|
|
||||||
# Set new image file hash
|
# Set new image file hash
|
||||||
self.file.seek(0)
|
|
||||||
self._set_file_hash(self.file.read())
|
self._set_file_hash(self.file.read())
|
||||||
self.file.seek(0)
|
self.file.seek(0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user