From 783265ad657e0c08443521423b2c381729628f20 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 1 Dec 2020 17:27:43 +0100 Subject: [PATCH] adding finale user to live action --- .../versions/e93aec8fc41f_added_assigned_action.py | 2 ++ ereuse_devicehub/resources/action/models.py | 3 +++ ereuse_devicehub/resources/action/schemas.py | 12 +++--------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ereuse_devicehub/migrations/versions/e93aec8fc41f_added_assigned_action.py b/ereuse_devicehub/migrations/versions/e93aec8fc41f_added_assigned_action.py index 48a74602..85aecb55 100644 --- a/ereuse_devicehub/migrations/versions/e93aec8fc41f_added_assigned_action.py +++ b/ereuse_devicehub/migrations/versions/e93aec8fc41f_added_assigned_action.py @@ -60,6 +60,8 @@ def upgrade(): op.drop_table('live', schema=f'{get_inv()}') op.create_table('live', sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False), + sa.Column('final_user_code', citext.CIText(), default='', nullable=True, + comment = "This is a internal code for mainteing the secrets of the personal datas of the new holder"), sa.Column('serial_number', sa.Unicode(), nullable=True, comment='The serial number of the Hard Disk in lower case.'), sa.Column('time', sa.SmallInteger(), nullable=True), diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index fadc23ad..3436993d 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -1299,6 +1299,9 @@ class Live(JoinedWithOneDeviceMixin, ActionWithOneDevice): information about its state (in the form of a ``Snapshot`` action) and usage statistics. """ + final_user_code = Column(CIText(), default='', nullable=True) + final_user_code.comment = """This is a internal code for mainteing the secrets of the + personal datas of the new holder""" serial_number = Column(Unicode(), check_lower('serial_number')) serial_number.comment = """The serial number of the Hard Disk in lower case.""" time = Column(SmallInteger, nullable=False) diff --git a/ereuse_devicehub/resources/action/schemas.py b/ereuse_devicehub/resources/action/schemas.py index 167793e9..864043c9 100644 --- a/ereuse_devicehub/resources/action/schemas.py +++ b/ereuse_devicehub/resources/action/schemas.py @@ -412,15 +412,9 @@ class Prepare(ActionWithMultipleDevices): class Live(ActionWithOneDevice): __doc__ = m.Live.__doc__ - ip = IP(dump_only=True) - subdivision_confidence = Integer(dump_only=True, data_key='subdivisionConfidence') - subdivision = EnumField(Subdivision, dump_only=True) - country = EnumField(Country, dump_only=True) - city = SanitizedStr(lower=True, dump_only=True) - city_confidence = Integer(dump_only=True, data_key='cityConfidence') - isp = SanitizedStr(lower=True, dump_only=True) - organization = SanitizedStr(lower=True, dump_only=True) - organization_type = SanitizedStr(lower=True, dump_only=True, data_key='organizationType') + final_user_code = SanitizedStr(data_key="finalUserCode", dump_only=True) + serial_number = SanitizedStr(data_key="serialNumber", dump_only=True) + time = Integer(dump_only=False) class Organize(ActionWithMultipleDevices):