fix command initial data

This commit is contained in:
Cayo Puigdefabregas 2024-01-21 13:46:01 +01:00
parent b63060ad31
commit 363944c8fe
1 changed files with 4 additions and 1 deletions

View File

@ -90,8 +90,11 @@ class Command(BaseCommand):
ldata = json.loads(data)
assert credtools.validate_schema(ldata)
dname = ldata.get('name')
title = ldata.get('title')
assert dname
assert title
except Exception:
title = ''
return
name = ''
try:
@ -101,7 +104,7 @@ class Command(BaseCommand):
except Exception:
return
Schemas.objects.create(file_schema=file_name, data=data, type=name)
Schemas.objects.create(file_schema=file_name, data=data, type=title)
def open_file(self, file_name):
data = ''