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): def create_schema(self, file_name):
data = self.open_file(file_name) data = self.open_file(file_name)
try: try:
json.loads(data)
ldata = json.loads(data) ldata = json.loads(data)
assert credtools.validate_schema(ldata) assert credtools.validate_schema(ldata)
name = ldata.get('name') 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.conf import settings
from django.db import migrations, models from django.db import migrations, models

View File

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