mirror of https://gitlab.com/bashrc2/epicyon
Set locations for roles
parent
8d6e5812be
commit
3dc34bd77d
14
person.py
14
person.py
|
@ -288,6 +288,10 @@ def _createPersonBase(baseDir: str, nickname: str, domain: str, port: int,
|
|||
{
|
||||
'@type': 'Occupation',
|
||||
'name': "",
|
||||
"location": {
|
||||
"@type": "VirtualLocation",
|
||||
"url": httpPrefix + '://' + domain
|
||||
},
|
||||
'skills': []
|
||||
}
|
||||
],
|
||||
|
@ -584,10 +588,15 @@ def personUpgradeActor(baseDir: str, personJson: {},
|
|||
# if the older skills format is being used then switch
|
||||
# to the new one
|
||||
if not personJson.get('hasOccupation'):
|
||||
personDomain = personJson['id'].split('/users/')[0]
|
||||
personJson['hasOccupation'] = [
|
||||
{
|
||||
'@type': 'Occupation',
|
||||
'name': occupationName,
|
||||
"location": {
|
||||
"@type": "VirtualLocation",
|
||||
"url": personDomain
|
||||
},
|
||||
'skills': []
|
||||
}
|
||||
]
|
||||
|
@ -605,10 +614,15 @@ def personUpgradeActor(baseDir: str, personJson: {},
|
|||
updateActor = True
|
||||
|
||||
if not isinstance(personJson['hasOccupation'], list):
|
||||
personDomain = personJson['id'].split('/users/')[0]
|
||||
personJson['hasOccupation'] = [
|
||||
{
|
||||
'@type': 'Occupation',
|
||||
'name': occupationName,
|
||||
"location": {
|
||||
"@type": "VirtualLocation",
|
||||
"url": personDomain
|
||||
},
|
||||
'skills': []
|
||||
}
|
||||
]
|
||||
|
|
|
@ -82,10 +82,15 @@ def setActorSkillLevel(actorJson: {},
|
|||
if not actorJson:
|
||||
return True
|
||||
if not actorJson.get('hasOccupation'):
|
||||
actorDomain = actorJson['id'].split('/users/')[0]
|
||||
actorJson['hasOccupation'] = [
|
||||
{
|
||||
'@type': 'Occupation',
|
||||
'name': '',
|
||||
"location": {
|
||||
"@type": "VirtualLocation",
|
||||
"url": actorDomain
|
||||
},
|
||||
'skills': []
|
||||
}
|
||||
]
|
||||
|
|
8
tests.py
8
tests.py
|
@ -3666,6 +3666,10 @@ def testSkills() -> None:
|
|||
{
|
||||
'@type': 'Occupation',
|
||||
'name': "Sysop",
|
||||
"location": {
|
||||
"@type": "VirtualLocation",
|
||||
"url": "https://jazzy.hedgehog"
|
||||
},
|
||||
'skills': []
|
||||
}
|
||||
]
|
||||
|
@ -3688,6 +3692,10 @@ def testRoles() -> None:
|
|||
{
|
||||
'@type': 'Occupation',
|
||||
'name': "Sysop",
|
||||
"location": {
|
||||
"@type": "VirtualLocation",
|
||||
"url": "https://mostly.giraffe"
|
||||
},
|
||||
'skills': []
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue