fix schema credential and csv examples

This commit is contained in:
Cayo Puigdefabregas 2023-11-21 10:00:59 +01:00
parent 821b6d3889
commit ed1f36c1a1
5 changed files with 18 additions and 8 deletions

View file

@ -1,2 +1,2 @@
name surnames email typeOfPerson membershipType organisation validFrom validUntil identityDocType identityNumber
Pepe Gómez user1@example.org individual Member Pangea 01-01-2023
name surnames email typeOfPerson membershipType organisation affiliatedSince
Pepe Gómez user1@example.org individual Member Pangea 01-01-2023

1 name surnames email typeOfPerson membershipType organisation validFrom affiliatedSince validUntil identityDocType identityNumber
2 Pepe Gómez user1@example.org individual Member Pangea 01-01-2023 01-01-2023

View file

@ -75,8 +75,10 @@ class ImportForm(forms.Form):
if not data_pd:
self.exception("This file is empty!")
properties = self.json_schema['properties']['credentialSubject']['properties']
head_row = {x: '' for x in properties.keys()}
for n in range(df.last_valid_index()+1):
row = {}
row = head_row.copy()
for k in data_pd.keys():
row[k] = data_pd[k][n] or ''

View file

@ -20,6 +20,8 @@
"lang": "https://gitea.pangea.org/trustchain-oc1-orchestral/schemas/contexts/vocab#lang",
"surnames": "https://gitea.pangea.org/trustchain-oc1-orchestral/schemas/contexts/vocab#surnames",
"email": "https://gitea.pangea.org/trustchain-oc1-orchestral/schemas/contexts/vocab#email",
"affiliatedSince": "https://gitea.pangea.org/trustchain-oc1-orchestral/schemas/contexts/vocab#affiliatedSince",
"affiliatedUntil": "https://gitea.pangea.org/trustchain-oc1-orchestral/schemas/contexts/vocab#affiliatedUntil",
"issued": "https://ec.europa.eu/digital-building-blocks/wikis/display/EBSIDOC/Verifiable+Attestation#issued",
"validFrom": "https://ec.europa.eu/digital-building-blocks/wikis/display/EBSIDOC/Verifiable+Attestation#validFrom",
"validUntil": "https://ec.europa.eu/digital-building-blocks/wikis/display/EBSIDOC/Verifiable+Attestation#validUntil"
@ -87,9 +89,11 @@
"organisation": "Pangea",
"membershipType": "{{ membershipType }}",
"membershipId": "{{ vc_id }}",
"AffiliatedFrom": "{{ AffiliatedFrom }}",
"AffiliatedUntil": "{{ AffiliatedUntil }}",
"affiliatedSince": "{{ affiliatedSince }}",
"affiliatedUntil": "{{ affiliatedUntil }}",
"typeOfPerson": "{{ typeOfPerson }}",
"identityDocType": "{{ identityDocType }}",
"identityNumber": "{{ identityNumber }}",
"name": "{{ first_name }}",
"surnames": "{{ last_name }}",
"email": "{{ email }}",

View file

@ -44,7 +44,10 @@ class RequestCredentialForm(forms.Form):
did = did[0].did
cred = cred[0]
cred.issue(did)
try:
cred.issue(did)
except Exception:
return
if commit:
cred.save()

View file

@ -14,11 +14,11 @@
"membershipType": {
"type": "string"
},
"AffiliatedFrom": {
"affiliatedSince": {
"type": "string",
"format": "date-time"
},
"AffiliatedUntil": {
"affiliatedUntil": {
"type": "string",
"format": "date-time"
},
@ -54,6 +54,7 @@
},
"required": [
"organisation",
"affiliatedSince",
"typeOfPerson",
"name",
"surnames",