Snake case

main
Bob Mottram 2021-12-26 14:11:30 +00:00
parent 6604143504
commit ae2cef4569
3 changed files with 20 additions and 20 deletions

View File

@ -822,8 +822,8 @@ def personUpgradeActor(base_dir: str, personJson: {},
# roles are configured
rolesList = getActorRolesList(personJson)
if not rolesList:
adminName = get_config_param(base_dir, 'admin')
if personJson['id'].endswith('/users/' + adminName):
admin_name = get_config_param(base_dir, 'admin')
if personJson['id'].endswith('/users/' + admin_name):
rolesList = ["admin", "moderator", "editor"]
setRolesFromList(personJson, rolesList)
updateActor = True

View File

@ -96,20 +96,20 @@ def isModerator(base_dir: str, nickname: str) -> bool:
moderatorsFile = base_dir + '/accounts/moderators.txt'
if not os.path.isfile(moderatorsFile):
adminName = get_config_param(base_dir, 'admin')
if not adminName:
admin_name = get_config_param(base_dir, 'admin')
if not admin_name:
return False
if adminName == nickname:
if admin_name == nickname:
return True
return False
with open(moderatorsFile, 'r') as f:
lines = f.readlines()
if len(lines) == 0:
adminName = get_config_param(base_dir, 'admin')
if not adminName:
admin_name = get_config_param(base_dir, 'admin')
if not admin_name:
return False
if adminName == nickname:
if admin_name == nickname:
return True
for moderator in lines:
moderator = moderator.strip('\n').strip('\r')

View File

@ -292,20 +292,20 @@ def is_editor(base_dir: str, nickname: str) -> bool:
editorsFile = base_dir + '/accounts/editors.txt'
if not os.path.isfile(editorsFile):
adminName = get_config_param(base_dir, 'admin')
if not adminName:
admin_name = get_config_param(base_dir, 'admin')
if not admin_name:
return False
if adminName == nickname:
if admin_name == nickname:
return True
return False
with open(editorsFile, 'r') as f:
lines = f.readlines()
if len(lines) == 0:
adminName = get_config_param(base_dir, 'admin')
if not adminName:
admin_name = get_config_param(base_dir, 'admin')
if not admin_name:
return False
if adminName == nickname:
if admin_name == nickname:
return True
for editor in lines:
editor = editor.strip('\n').strip('\r')
@ -320,20 +320,20 @@ def isArtist(base_dir: str, nickname: str) -> bool:
artistsFile = base_dir + '/accounts/artists.txt'
if not os.path.isfile(artistsFile):
adminName = get_config_param(base_dir, 'admin')
if not adminName:
admin_name = get_config_param(base_dir, 'admin')
if not admin_name:
return False
if adminName == nickname:
if admin_name == nickname:
return True
return False
with open(artistsFile, 'r') as f:
lines = f.readlines()
if len(lines) == 0:
adminName = get_config_param(base_dir, 'admin')
if not adminName:
admin_name = get_config_param(base_dir, 'admin')
if not admin_name:
return False
if adminName == nickname:
if admin_name == nickname:
return True
for artist in lines:
artist = artist.strip('\n').strip('\r')