Corrections

This commit is contained in:
Filoji 2020-07-23 10:01:57 +02:00
parent 1689f73e89
commit 20622315bd
1 changed files with 3 additions and 3 deletions

View File

@ -2,8 +2,8 @@ from app import db
from hashlib import sha256
import os
class Attachement(db.Model):
__tablename__ = 'attachement'
class Attachment(db.Model):
__tablename__ = 'attachment'
id = db.Column(db.Integer, primary_key=True)
# Original name of the file
@ -22,7 +22,7 @@ class Attachement(db.Model):
def __init__(self, file, comment):
self.name = file.filename
self.size = os.stat(file).st_size
self.hashed = hash_file(file)
self.hashed = self.hash_file(file)
self.comment = comment
def hash_file(file):