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',
|
'@type': 'Occupation',
|
||||||
'name': "",
|
'name': "",
|
||||||
|
"location": {
|
||||||
|
"@type": "VirtualLocation",
|
||||||
|
"url": httpPrefix + '://' + domain
|
||||||
|
},
|
||||||
'skills': []
|
'skills': []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -584,10 +588,15 @@ def personUpgradeActor(baseDir: str, personJson: {},
|
||||||
# if the older skills format is being used then switch
|
# if the older skills format is being used then switch
|
||||||
# to the new one
|
# to the new one
|
||||||
if not personJson.get('hasOccupation'):
|
if not personJson.get('hasOccupation'):
|
||||||
|
personDomain = personJson['id'].split('/users/')[0]
|
||||||
personJson['hasOccupation'] = [
|
personJson['hasOccupation'] = [
|
||||||
{
|
{
|
||||||
'@type': 'Occupation',
|
'@type': 'Occupation',
|
||||||
'name': occupationName,
|
'name': occupationName,
|
||||||
|
"location": {
|
||||||
|
"@type": "VirtualLocation",
|
||||||
|
"url": personDomain
|
||||||
|
},
|
||||||
'skills': []
|
'skills': []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -605,10 +614,15 @@ def personUpgradeActor(baseDir: str, personJson: {},
|
||||||
updateActor = True
|
updateActor = True
|
||||||
|
|
||||||
if not isinstance(personJson['hasOccupation'], list):
|
if not isinstance(personJson['hasOccupation'], list):
|
||||||
|
personDomain = personJson['id'].split('/users/')[0]
|
||||||
personJson['hasOccupation'] = [
|
personJson['hasOccupation'] = [
|
||||||
{
|
{
|
||||||
'@type': 'Occupation',
|
'@type': 'Occupation',
|
||||||
'name': occupationName,
|
'name': occupationName,
|
||||||
|
"location": {
|
||||||
|
"@type": "VirtualLocation",
|
||||||
|
"url": personDomain
|
||||||
|
},
|
||||||
'skills': []
|
'skills': []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -82,10 +82,15 @@ def setActorSkillLevel(actorJson: {},
|
||||||
if not actorJson:
|
if not actorJson:
|
||||||
return True
|
return True
|
||||||
if not actorJson.get('hasOccupation'):
|
if not actorJson.get('hasOccupation'):
|
||||||
|
actorDomain = actorJson['id'].split('/users/')[0]
|
||||||
actorJson['hasOccupation'] = [
|
actorJson['hasOccupation'] = [
|
||||||
{
|
{
|
||||||
'@type': 'Occupation',
|
'@type': 'Occupation',
|
||||||
'name': '',
|
'name': '',
|
||||||
|
"location": {
|
||||||
|
"@type": "VirtualLocation",
|
||||||
|
"url": actorDomain
|
||||||
|
},
|
||||||
'skills': []
|
'skills': []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
8
tests.py
8
tests.py
|
@ -3666,6 +3666,10 @@ def testSkills() -> None:
|
||||||
{
|
{
|
||||||
'@type': 'Occupation',
|
'@type': 'Occupation',
|
||||||
'name': "Sysop",
|
'name': "Sysop",
|
||||||
|
"location": {
|
||||||
|
"@type": "VirtualLocation",
|
||||||
|
"url": "https://jazzy.hedgehog"
|
||||||
|
},
|
||||||
'skills': []
|
'skills': []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -3688,6 +3692,10 @@ def testRoles() -> None:
|
||||||
{
|
{
|
||||||
'@type': 'Occupation',
|
'@type': 'Occupation',
|
||||||
'name': "Sysop",
|
'name': "Sysop",
|
||||||
|
"location": {
|
||||||
|
"@type": "VirtualLocation",
|
||||||
|
"url": "https://mostly.giraffe"
|
||||||
|
},
|
||||||
'skills': []
|
'skills': []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue