mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
6604143504
commit
ae2cef4569
|
@ -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
|
||||
|
|
12
posts.py
12
posts.py
|
@ -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')
|
||||
|
|
24
utils.py
24
utils.py
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue