fix merge

This commit is contained in:
Cayo Puigdefabregas 2023-12-01 18:20:53 +01:00
commit aedd04398d
4 changed files with 7 additions and 17 deletions

View File

@ -820,7 +820,6 @@ class SchemasImportAddView(SchemasMix):
def create_schema(self, file_name):
data = self.open_file(file_name)
try:
json.loads(data)
ldata = json.loads(data)
assert credtools.validate_schema(ldata)
name = ldata.get('name')

View File

@ -1,4 +1,4 @@
# Generated by Django 4.2.5 on 2023-11-29 16:14
# Generated by Django 4.2.5 on 2023-12-01 17:19
from django.conf import settings
from django.db import migrations, models

View File

@ -486,22 +486,11 @@ class VerificableCredential(models.Model):
related_name='vcredentials',
)
@property
def get_schema(self):
if not self.data:
return {}
return json.loads(self.data)
def type(self):
# if self.data and:
# return self.get_schema.get('type')[-1]
return self.schema.type
def description(self):
if not self.data:
return self.schema.description()
for des in self.get_schema.get('description', []):
for des in json.loads(self.render()).get('description', []):
if settings.LANGUAGE_CODE == des.get('lang'):
return des.get('value', '')
return ''
@ -527,8 +516,10 @@ class VerificableCredential(models.Model):
def get_context(self):
d = json.loads(self.csv_data)
format = "%Y-%m-%dT%H:%M:%SZ"
issuance_date = self.issued_on.strftime(format)
issuance_date = ''
if self.issued_on:
format = "%Y-%m-%dT%H:%M:%SZ"
issuance_date = self.issued_on.strftime(format)
context = {
'vc_id': self.id,

View File

@ -1,4 +1,4 @@
# Generated by Django 4.2.5 on 2023-11-15 09:58
# Generated by Django 4.2.5 on 2023-12-01 17:19
from django.db import migrations, models