From d45be274ee134e47ee1addc3176fe1e51e0e9262 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 21 Feb 2024 10:17:00 +0100 Subject: [PATCH] show datas from credential in credential view --- idhub/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/idhub/models.py b/idhub/models.py index 7d6a1c6..8373373 100644 --- a/idhub/models.py +++ b/idhub/models.py @@ -645,8 +645,9 @@ class VerificableCredential(models.Model): return self.Status(self.status).label def get_datas(self): - data = json.loads(self.csv_data).items() - return data + data = self.render() + credential_subject = ujson.loads(data).get("credentialSubject", {}) + return credential_subject.items() def issue(self, did, domain=settings.DOMAIN.strip("/")): if self.status == self.Status.ISSUED: @@ -702,7 +703,7 @@ class VerificableCredential(models.Model): context.update(d) return context - def render(self, domain): + def render(self, domain=""): context = self.get_context(domain) template_name = 'credentials/{}'.format( self.schema.file_schema