0
0
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:
Matt Westcott 2022-08-02 16:08:08 +02:00 committed by Matt Westcott
parent 8ca7cc72d5
commit 0ab0ecc78f
2 changed files with 0 additions and 2 deletions

View File

@ -141,7 +141,6 @@ class AbstractDocument(CollectionMember, index.Indexed, models.Model):
self.file_size = self.file.size
# Set new document file hash
self.file.seek(0)
self._set_file_hash(self.file.read())
self.file.seek(0)

View File

@ -243,7 +243,6 @@ class AbstractImage(ImageFileMixin, CollectionMember, index.Indexed, models.Mode
self.file_size = self.file.size
# Set new image file hash
self.file.seek(0)
self._set_file_hash(self.file.read())
self.file.seek(0)