we only need the data files

This commit is contained in:
Cayo Puigdefabregas 2021-08-06 11:08:58 +02:00
parent eed117808c
commit ed43bd477c
3 changed files with 5 additions and 5 deletions

View File

@ -45,7 +45,7 @@ def upgrade():
sa.Column('owner_id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('file_name', sa.Unicode(), nullable=False),
sa.Column('file_hash', sa.Unicode(), nullable=False),
sa.Column('url', sa.Unicode(), nullable=False),
sa.Column('url', sa.Unicode(), nullable=True),
sa.ForeignKeyConstraint(['owner_id'], ['common.user.id'], ),
sa.PrimaryKeyConstraint('id'),

View File

@ -31,7 +31,7 @@ class Document(Thing):
file_name.comment = """This is the name of the file when user up the document."""
file_hash = Column(db.CIText(), nullable=False)
file_hash.comment = """This is the hash of the file produced from frontend."""
url = db.Column(URL(), nullable=False)
url = db.Column(URL(), nullable=True)
url.comment = """This is the url where resides the document."""
def __str__(self) -> str:
@ -50,7 +50,7 @@ class DataWipeDocument(JoinedTableMixin, Document):
software = Column(CIText(), nullable=True)
software.comment = """Which software is used"""
success = Column(Boolean)
success = Column(Boolean, default=False)
success.comment = """If the erase was success"""
def __str__(self) -> str:

View File

@ -8,8 +8,8 @@ class DataWipeDocument(Thing):
__doc__ = m.DataWipeDocument.__doc__
id = Integer(description=m.DataWipeDocument.id.comment, dump_only=True)
type = SanitizedStr(default='DataWipeDocument')
url = URL(description=m.DataWipeDocument.url.comment)
success = Boolean(description=m.DataWipeDocument.success.comment)
url = URL(required= False, description=m.DataWipeDocument.url.comment)
success = Boolean(required=False, default=False, description=m.DataWipeDocument.success.comment)
software = SanitizedStr(description=m.DataWipeDocument.software.comment)
date = DateTime(data_key='endTime',
required=False,