diff --git a/daemon.py b/daemon.py index dc66fd9f6..ace5277b3 100644 --- a/daemon.py +++ b/daemon.py @@ -274,7 +274,7 @@ from utils import get_locked_account from utils import has_users_path from utils import get_full_domain from utils import removeHtml -from utils import isEditor +from utils import is_editor from utils import isArtist from utils import getImageExtensions from utils import mediaFileMimeType @@ -4075,7 +4075,7 @@ class PubServer(BaseHTTPRequestHandler): nickname = getNicknameFromActor(actorStr) editor = None if nickname: - editor = isEditor(base_dir, nickname) + editor = is_editor(base_dir, nickname) if not nickname or not editor: if not nickname: print('WARN: nickname not found in ' + actorStr) @@ -4234,7 +4234,7 @@ class PubServer(BaseHTTPRequestHandler): nickname = getNicknameFromActor(actorStr) editor = None if nickname: - editor = isEditor(base_dir, nickname) + editor = is_editor(base_dir, nickname) if not hashtag or not editor: if not nickname: print('WARN: nickname not found in ' + actorStr) @@ -4562,7 +4562,7 @@ class PubServer(BaseHTTPRequestHandler): nickname = getNicknameFromActor(actorStr) editorRole = None if nickname: - editorRole = isEditor(base_dir, nickname) + editorRole = is_editor(base_dir, nickname) if not nickname or not editorRole: if not nickname: print('WARN: nickname not found in ' + actorStr) @@ -10954,7 +10954,7 @@ class PubServer(BaseHTTPRequestHandler): if '/' in currNickname: currNickname = currNickname.split('/')[0] moderator = isModerator(base_dir, currNickname) - editor = isEditor(base_dir, currNickname) + editor = is_editor(base_dir, currNickname) artist = isArtist(base_dir, currNickname) full_width_tl_button_header = \ self.server.full_width_tl_button_header diff --git a/utils.py b/utils.py index 4ce8d875c..4100cb952 100644 --- a/utils.py +++ b/utils.py @@ -286,7 +286,7 @@ def is_dormant(base_dir: str, nickname: str, domain: str, actor: str, return False -def isEditor(base_dir: str, nickname: str) -> bool: +def is_editor(base_dir: str, nickname: str) -> bool: """Returns true if the given nickname is an editor """ editorsFile = base_dir + '/accounts/editors.txt' diff --git a/webapp_column_left.py b/webapp_column_left.py index 3093eb372..ed0cf7083 100644 --- a/webapp_column_left.py +++ b/webapp_column_left.py @@ -10,7 +10,7 @@ __module_group__ = "Web Interface Columns" import os from utils import getConfigParam from utils import getNicknameFromActor -from utils import isEditor +from utils import is_editor from utils import isArtist from utils import removeDomainPort from utils import local_actor_url @@ -371,7 +371,7 @@ def htmlLinksMobile(cssCache: {}, base_dir: str, editor = False artist = False else: - editor = isEditor(base_dir, nickname) + editor = is_editor(base_dir, nickname) artist = isArtist(base_dir, nickname) domain = removeDomainPort(domain_full) @@ -429,7 +429,7 @@ def htmlEditLinks(cssCache: {}, translate: {}, base_dir: str, path: str, return '' # is the user a moderator? - if not isEditor(base_dir, nickname): + if not is_editor(base_dir, nickname): return '' cssFilename = base_dir + '/epicyon-links.css' diff --git a/webapp_column_right.py b/webapp_column_right.py index 3641987f1..cdf63a41c 100644 --- a/webapp_column_right.py +++ b/webapp_column_right.py @@ -18,7 +18,7 @@ from utils import locatePost from utils import loadJson from utils import votesOnNewswireItem from utils import getNicknameFromActor -from utils import isEditor +from utils import is_editor from utils import getConfigParam from utils import removeDomainPort from utils import acct_dir @@ -474,7 +474,7 @@ def htmlNewswireMobile(cssCache: {}, base_dir: str, nickname: str, moderator = isModerator(base_dir, nickname) # is the user a site editor? - editor = isEditor(base_dir, nickname) + editor = is_editor(base_dir, nickname) showPublishButton = editor @@ -655,7 +655,7 @@ def htmlEditNewsPost(cssCache: {}, translate: {}, base_dir: str, path: str, return '' # is the user an editor? - if not isEditor(base_dir, nickname): + if not is_editor(base_dir, nickname): return '' postUrl = postUrl.replace('/', '#') diff --git a/webapp_moderation.py b/webapp_moderation.py index d0a4b9dae..a8be72063 100644 --- a/webapp_moderation.py +++ b/webapp_moderation.py @@ -11,7 +11,7 @@ import os from utils import isArtist from utils import isAccountDir from utils import get_full_domain -from utils import isEditor +from utils import is_editor from utils import loadJson from utils import getNicknameFromActor from utils import getDomainFromActor @@ -344,7 +344,7 @@ def htmlModerationInfo(cssCache: {}, translate: {}, infoForm += '' + acctNickname + '' else: infoForm += acctNickname - if isEditor(base_dir, acctNickname): + if is_editor(base_dir, acctNickname): infoForm += ' ✍' infoForm += '\n\n' col += 1 diff --git a/webapp_post.py b/webapp_post.py index 6d8325376..bb4adb470 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -36,7 +36,7 @@ from utils import rejectPostId from utils import isRecentPost from utils import getConfigParam from utils import get_full_domain -from utils import isEditor +from utils import is_editor from utils import locatePost from utils import loadJson from utils import getCachedPostDirectory @@ -472,7 +472,7 @@ def _getEditIconHtml(base_dir: str, nickname: str, domain_full: str, # _addBlogsToNewswire) in which case anyone with # editor status should be able to alter it if (actor.endswith('/' + domain_full + '/users/' + nickname) or - (isEditor(base_dir, nickname) and + (is_editor(base_dir, nickname) and actor.endswith('/' + domain_full + '/users/news'))): postId = removeIdEnding(post_json_object['object']['id']) diff --git a/webapp_search.py b/webapp_search.py index 59deebc17..0f356a7c8 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -15,7 +15,7 @@ from utils import get_base_content_from_post from utils import isAccountDir from utils import getConfigParam from utils import get_full_domain -from utils import isEditor +from utils import is_editor from utils import loadJson from utils import getDomainFromActor from utils import getNicknameFromActor @@ -785,7 +785,7 @@ def htmlHashtagSearch(cssCache: {}, 'icons/logorss.png" />\n' # edit the category for this hashtag - if isEditor(base_dir, nickname): + if is_editor(base_dir, nickname): category = getHashtagCategory(base_dir, hashtag) hashtagSearchForm += '