Skills metadata

main
Bob Mottram 2021-05-16 11:52:16 +01:00
parent a0d10b7c14
commit c1eda4399b
2 changed files with 6 additions and 2 deletions

View File

@ -578,9 +578,11 @@ def personUpgradeActor(baseDir: str, personJson: {},
if personJson.get('occupationName'):
occupationName = personJson['occupationName']
del personJson['occupationName']
updateActor = True
if personJson.get('occupation'):
occupationName = personJson['occupation']
del personJson['occupation']
updateActor = True
# if the older skills format is being used then switch
# to the new one

View File

@ -722,10 +722,12 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str,
skillsMarkup = ''
if actorJson.get('hasOccupation'):
skillsList = actorJson['hasOccupation']['skills']
occupationStr = ''
if actorJson['hasOccupation'].get('name'):
occupationName = actorJson['hasOccupation']['name']
occupationStr = ' "name": "' + occupationName + '",\n'
occupationStr += ' "name": "' + occupationName + '",\n'
skillsList = actorJson['hasOccupation']['skills']
if skillsList:
skillsMarkup = \
' "hasOccupation": {\n' + \
' "@type": "Occupation",\n' + \