show datas from credential in credential view
This commit is contained in:
parent
996288460c
commit
d45be274ee
|
@ -645,8 +645,9 @@ class VerificableCredential(models.Model):
|
||||||
return self.Status(self.status).label
|
return self.Status(self.status).label
|
||||||
|
|
||||||
def get_datas(self):
|
def get_datas(self):
|
||||||
data = json.loads(self.csv_data).items()
|
data = self.render()
|
||||||
return data
|
credential_subject = ujson.loads(data).get("credentialSubject", {})
|
||||||
|
return credential_subject.items()
|
||||||
|
|
||||||
def issue(self, did, domain=settings.DOMAIN.strip("/")):
|
def issue(self, did, domain=settings.DOMAIN.strip("/")):
|
||||||
if self.status == self.Status.ISSUED:
|
if self.status == self.Status.ISSUED:
|
||||||
|
@ -702,7 +703,7 @@ class VerificableCredential(models.Model):
|
||||||
context.update(d)
|
context.update(d)
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def render(self, domain):
|
def render(self, domain=""):
|
||||||
context = self.get_context(domain)
|
context = self.get_context(domain)
|
||||||
template_name = 'credentials/{}'.format(
|
template_name = 'credentials/{}'.format(
|
||||||
self.schema.file_schema
|
self.schema.file_schema
|
||||||
|
|
Loading…
Reference in New Issue