mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
4387e21ba4
commit
ba6320e3f5
|
@ -265,7 +265,7 @@ from utils import permitted_dir
|
||||||
from utils import is_account_dir
|
from utils import is_account_dir
|
||||||
from utils import getOccupationSkills
|
from utils import getOccupationSkills
|
||||||
from utils import getOccupationName
|
from utils import getOccupationName
|
||||||
from utils import setOccupationName
|
from utils import set_occupation_name
|
||||||
from utils import loadTranslationsFromFile
|
from utils import loadTranslationsFromFile
|
||||||
from utils import getLocalNetworkAddresses
|
from utils import getLocalNetworkAddresses
|
||||||
from utils import decoded_host
|
from utils import decoded_host
|
||||||
|
@ -5479,12 +5479,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
removeHtml(fields['occupationName'])
|
removeHtml(fields['occupationName'])
|
||||||
if occupationName != \
|
if occupationName != \
|
||||||
fields['occupationName']:
|
fields['occupationName']:
|
||||||
setOccupationName(actor_json,
|
set_occupation_name(actor_json,
|
||||||
fields['occupationName'])
|
fields['occupationName'])
|
||||||
actorChanged = True
|
actorChanged = True
|
||||||
else:
|
else:
|
||||||
if occupationName:
|
if occupationName:
|
||||||
setOccupationName(actor_json, '')
|
set_occupation_name(actor_json, '')
|
||||||
actorChanged = True
|
actorChanged = True
|
||||||
|
|
||||||
# Other accounts (alsoKnownAs)
|
# Other accounts (alsoKnownAs)
|
||||||
|
|
12
utils.py
12
utils.py
|
@ -2765,7 +2765,7 @@ def getOccupationName(actor_json: {}) -> str:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
def setOccupationName(actor_json: {}, name: str) -> bool:
|
def set_occupation_name(actor_json: {}, name: str) -> bool:
|
||||||
"""Sets the occupation name of an actor
|
"""Sets the occupation name of an actor
|
||||||
"""
|
"""
|
||||||
if not actor_json.get('hasOccupation'):
|
if not actor_json.get('hasOccupation'):
|
||||||
|
@ -2773,14 +2773,14 @@ def setOccupationName(actor_json: {}, name: str) -> bool:
|
||||||
if not isinstance(actor_json['hasOccupation'], list):
|
if not isinstance(actor_json['hasOccupation'], list):
|
||||||
return False
|
return False
|
||||||
for index in range(len(actor_json['hasOccupation'])):
|
for index in range(len(actor_json['hasOccupation'])):
|
||||||
occupationItem = actor_json['hasOccupation'][index]
|
occupation_item = actor_json['hasOccupation'][index]
|
||||||
if not isinstance(occupationItem, dict):
|
if not isinstance(occupation_item, dict):
|
||||||
continue
|
continue
|
||||||
if not occupationItem.get('@type'):
|
if not occupation_item.get('@type'):
|
||||||
continue
|
continue
|
||||||
if occupationItem['@type'] != 'Occupation':
|
if occupation_item['@type'] != 'Occupation':
|
||||||
continue
|
continue
|
||||||
occupationItem['name'] = name
|
occupation_item['name'] = name
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue