fixed proof register
This commit is contained in:
parent
1907f2508a
commit
599f15d5ae
|
@ -901,13 +901,14 @@ class Device(Thing):
|
||||||
from ereuse_devicehub.resources.did.models import PROOF_ENUM, Proof
|
from ereuse_devicehub.resources.did.models import PROOF_ENUM, Proof
|
||||||
from ereuse_devicehub.resources.enums import StatusCode
|
from ereuse_devicehub.resources.enums import StatusCode
|
||||||
|
|
||||||
# import pdb; pdb.set_trace()
|
|
||||||
if result['Status'] == StatusCode.Success:
|
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 = {
|
d = {
|
||||||
"type": PROOF_ENUM['Register'],
|
"type": PROOF_ENUM['Register'],
|
||||||
"device_id": self.id,
|
"device": self,
|
||||||
"snapshot": self,
|
"snapshot": [x for x in self.actions if x.t == 'Snapshot'][0],
|
||||||
"timestamp": timestamp,
|
"timestamp": timestamp,
|
||||||
"issuer_id": g.user.id,
|
"issuer_id": g.user.id,
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue