Skip to content
Snippets Groups Projects
Commit 0dda2def authored by Benjamin Becker's avatar Benjamin Becker
Browse files

resets file pointer to 0

parent 66d41a57
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ def _raise_validation_error_if_virus_found(filename, upload_file): ...@@ -29,6 +29,7 @@ def _raise_validation_error_if_virus_found(filename, upload_file):
def calculate_hash(upload_file): def calculate_hash(upload_file):
upload_file.seek(0)
hash_md5 = hashlib.md5() hash_md5 = hashlib.md5()
for chunk in iter(lambda: upload_file.read(4096), b""): for chunk in iter(lambda: upload_file.read(4096), b""):
hash_md5.update(chunk) hash_md5.update(chunk)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment