From 3a7eb0f97edbb42a29c07a14defbed3407039b90 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 29 Nov 2024 10:59:36 +0100 Subject: [PATCH] issue with out save credential --- idhub/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/idhub/models.py b/idhub/models.py index e68c905..d6ecfb1 100644 --- a/idhub/models.py +++ b/idhub/models.py @@ -680,7 +680,7 @@ class VerificableCredential(models.Model): credential_subject = ujson.loads(data).get("credentialSubject", {}) return credential_subject.items() - def issue(self, did, domain): + def issue(self, did, domain, encrypt=True): if self.status == self.Status.ISSUED: return @@ -700,6 +700,9 @@ class VerificableCredential(models.Model): if not valid: return + if not encrypt: + return vc_str + self.data = self.user.encrypt_data(vc_str) self.status = self.Status.ISSUED