From 1689f73e896b113ba065251c08d4b0117601e65b Mon Sep 17 00:00:00 2001 From: Filoji Date: Wed, 22 Jul 2020 17:51:23 +0200 Subject: [PATCH] Correct errors --- app/models/attachement.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/attachement.py b/app/models/attachement.py index 0634847..cbc5ace 100644 --- a/app/models/attachement.py +++ b/app/models/attachement.py @@ -22,11 +22,11 @@ class Attachement(db.Model): def __init__(self, file, comment): self.name = file.filename self.size = os.stat(file).st_size - self.hashed = str(hash_file(file)) + self.hashed = hash_file(file) self.comment = comment def hash_file(file): with open(file,"rb") as f: bytes = f.read() # read entire file as bytes - hashed = hashlib.sha256(bytes).hexdigest() + hashed = sha256(bytes).hexdigest() return hashed \ No newline at end of file