From 599f15d5ae2a6713cc989f05469133693cfe30f5 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 20 Feb 2023 11:37:19 +0100 Subject: [PATCH] fixed proof register --- ereuse_devicehub/resources/device/models.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index e1464a17..e0931f8a 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -901,13 +901,14 @@ class Device(Thing): from ereuse_devicehub.resources.did.models import PROOF_ENUM, Proof from ereuse_devicehub.resources.enums import StatusCode - # import pdb; pdb.set_trace() if result['Status'] == StatusCode.Success: - timestamp = result['Data'].get('data', {}).get('timestamp', time.time()) + timestamp = ( + result.get('Data', {}).get('data', {}).get('timestamp', time.time()) + ) d = { "type": PROOF_ENUM['Register'], - "device_id": self.id, - "snapshot": self, + "device": self, + "snapshot": [x for x in self.actions if x.t == 'Snapshot'][0], "timestamp": timestamp, "issuer_id": g.user.id, }