Set flag if users path is found

merge-requests/30/head
Bob Mottram 2021-07-04 20:59:08 +01:00
parent 4697de88c0
commit 907f3d8366
2 changed files with 11 additions and 11 deletions

View File

@ -1220,6 +1220,7 @@ def getActorJson(hostDomain: str, handle: str, http: bool, gnunet: bool,
nickname = handle.split(userPath)[1] nickname = handle.split(userPath)[1]
nickname = nickname.replace('\n', '').replace('\r', '') nickname = nickname.replace('\n', '').replace('\r', '')
domain = handle.split(userPath)[0] domain = handle.split(userPath)[0]
userPathFound = True
break break
if not userPathFound and '://' in originalHandle: if not userPathFound and '://' in originalHandle:
domain = originalHandle.split('://')[1] domain = originalHandle.split('://')[1]
@ -1245,6 +1246,7 @@ def getActorJson(hostDomain: str, handle: str, http: bool, gnunet: bool,
nickname = handle.split('@')[0] nickname = handle.split('@')[0]
domain = handle.split('@')[1] domain = handle.split('@')[1]
domain = domain.replace('\n', '').replace('\r', '') domain = domain.replace('\n', '').replace('\r', '')
cachedWebfingers = {} cachedWebfingers = {}
proxyType = None proxyType = None
if http or domain.endswith('.onion'): if http or domain.endswith('.onion'):

View File

@ -83,17 +83,15 @@ def setActorSkillLevel(actorJson: {},
if not actorJson: if not actorJson:
return True return True
if not actorJson.get('hasOccupation'): if not actorJson.get('hasOccupation'):
actorJson['hasOccupation'] = [ actorJson['hasOccupation'] = [{
{ '@type': 'Occupation',
'@type': 'Occupation', 'name': '',
'name': '', "occupationLocation": {
"occupationLocation": { "@type": "City",
"@type": "City", "name": "Fediverse"
"name": "Fediverse" },
}, 'skills': []
'skills': [] }]
}
]
ocSkillsList = getOccupationSkills(actorJson) ocSkillsList = getOccupationSkills(actorJson)
skillsDict = getSkillsFromList(ocSkillsList) skillsDict = getSkillsFromList(ocSkillsList)
if not skillsDict.get(skill): if not skillsDict.get(skill):