add result for dpp and for chid
This commit is contained in:
parent
5631da453a
commit
6efcf5ac18
|
@ -116,6 +116,7 @@ class Device:
|
||||||
return
|
return
|
||||||
annotation = annotations.first()
|
annotation = annotations.first()
|
||||||
self.last_evidence = Evidence(annotation.uuid)
|
self.last_evidence = Evidence(annotation.uuid)
|
||||||
|
self.uuid = annotation.uuid
|
||||||
|
|
||||||
def is_eraseserver(self):
|
def is_eraseserver(self):
|
||||||
if not self.uuids:
|
if not self.uuids:
|
||||||
|
|
31
did/views.py
31
did/views.py
|
@ -6,6 +6,7 @@ from django.views.generic.base import TemplateView
|
||||||
from device.models import Device
|
from device.models import Device
|
||||||
from dpp.api_dlt import ALGORITHM
|
from dpp.api_dlt import ALGORITHM
|
||||||
from dpp.models import Proof
|
from dpp.models import Proof
|
||||||
|
from dpp.api_dlt import PROOF_TYPE
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger('django')
|
logger = logging.getLogger('django')
|
||||||
|
@ -98,18 +99,24 @@ class PublicDeviceWebView(TemplateView):
|
||||||
'data': data,
|
'data': data,
|
||||||
}
|
}
|
||||||
|
|
||||||
# if self.dpp:
|
if len(self.pk.split(":")) > 1:
|
||||||
# data['document'] = self.dpp.snapshot.json_hw
|
data['document'] = json.dumps(self.object.last_evidence.doc)
|
||||||
# last_dpp = self.get_last_dpp()
|
|
||||||
# url_last = ''
|
self.object.get_evidences()
|
||||||
# if last_dpp:
|
last_dpp = Proof.objects.filter(
|
||||||
# url_last = 'https://{host}/{did}'.format(
|
uuid__in=self.object.uuids, type=PROOF_TYPE['IssueDPP']
|
||||||
# did=last_dpp.key, host=app.config.get('HOST')
|
).order_by("-timestamp").first()
|
||||||
# )
|
|
||||||
# data['url_last'] = url_last
|
key = self.pk
|
||||||
# for c in self.dpp.snapshot.components:
|
if last_dpp:
|
||||||
# components.append({c.type: c.chid})
|
key = last_dpp.signature
|
||||||
# return result
|
|
||||||
|
url = "https://{}/did/{}".format(
|
||||||
|
self.request.get_host(),
|
||||||
|
key
|
||||||
|
)
|
||||||
|
data['url_last'] = url
|
||||||
|
return result
|
||||||
|
|
||||||
dpps = []
|
dpps = []
|
||||||
self.object.initial()
|
self.object.initial()
|
||||||
|
|
Loading…
Reference in a new issue