Convert strings to lists

merge-requests/30/head
Bob Mottram 2021-05-14 19:02:58 +01:00
parent e44ed60ffc
commit 2306d8d393
1 changed files with 10 additions and 0 deletions

View File

@ -590,6 +590,11 @@ def personUpgradeActor(baseDir: str, personJson: {},
}
updateActor = True
if isinstance(personJson['hasOccupation']['skills'], str):
skillsList = personJson['hasOccupation']['skills'].split(', ')
personJson['hasOccupation']['skills'] = skillsList
updateActor = True
# remove the old skills format
if personJson.get('skills'):
del personJson['skills']
@ -614,6 +619,11 @@ def personUpgradeActor(baseDir: str, personJson: {},
}
updateActor = True
if isinstance(personJson['affiliation']['roleName'], str):
rolesList = personJson['affiliation']['roleName'].split(', ')
personJson['affiliation']['roleName'] = rolesList
updateActor = True
# if no roles are defined then ensure that the admin
# roles are configured
if not personJson['affiliation']['roleName']: