Snake case

main
Bob Mottram 2021-12-26 12:16:36 +00:00
parent 41d8c2edde
commit 65e42a7c12
3 changed files with 7 additions and 7 deletions

View File

@ -270,7 +270,7 @@ from utils import loadTranslationsFromFile
from utils import getLocalNetworkAddresses from utils import getLocalNetworkAddresses
from utils import decodedHost from utils import decodedHost
from utils import isPublicPost from utils import isPublicPost
from utils import getLockedAccount from utils import get_locked_account
from utils import hasUsersPath from utils import hasUsersPath
from utils import getFullDomain from utils import getFullDomain
from utils import removeHtml from utils import removeHtml
@ -7116,7 +7116,7 @@ class PubServer(BaseHTTPRequestHandler):
movedTo = movedTo.split('"')[1] movedTo = movedTo.split('"')[1]
if actor_json['type'] == 'Group': if actor_json['type'] == 'Group':
isGroup = True isGroup = True
lockedAccount = getLockedAccount(actor_json) lockedAccount = get_locked_account(actor_json)
donateUrl = getDonationUrl(actor_json) donateUrl = getDonationUrl(actor_json)
websiteUrl = getWebsite(actor_json, self.server.translate) websiteUrl = getWebsite(actor_json, self.server.translate)
xmppAddress = getXmppAddress(actor_json) xmppAddress = getXmppAddress(actor_json)

View File

@ -157,7 +157,7 @@ def get_sha_512(msg: str):
return digest.finalize() return digest.finalize()
def _localNetworkHost(host: str) -> bool: def _local_network_host(host: str) -> bool:
"""Returns true if the given host is on the local network """Returns true if the given host is on the local network
""" """
if host.startswith('localhost') or \ if host.startswith('localhost') or \
@ -174,14 +174,14 @@ def decodedHost(host: str) -> str:
""" """
if ':' not in host: if ':' not in host:
# eg. mydomain:8000 # eg. mydomain:8000
if not _localNetworkHost(host): if not _local_network_host(host):
if not host.endswith('.onion'): if not host.endswith('.onion'):
if not host.endswith('.i2p'): if not host.endswith('.i2p'):
return idna.decode(host) return idna.decode(host)
return host return host
def getLockedAccount(actor_json: {}) -> bool: def get_locked_account(actor_json: {}) -> bool:
"""Returns whether the given account requires follower approval """Returns whether the given account requires follower approval
""" """
if not actor_json.get('manuallyApprovesFollowers'): if not actor_json.get('manuallyApprovesFollowers'):

View File

@ -14,7 +14,7 @@ from utils import getDisplayName
from utils import isGroupAccount from utils import isGroupAccount
from utils import has_object_dict from utils import has_object_dict
from utils import getOccupationName from utils import getOccupationName
from utils import getLockedAccount from utils import get_locked_account
from utils import getFullDomain from utils import getFullDomain
from utils import isArtist from utils import isArtist
from utils import isDormant from utils import isDormant
@ -185,7 +185,7 @@ def htmlProfileAfterSearch(cssCache: {},
if profile_json.get('name'): if profile_json.get('name'):
displayName = profile_json['name'] displayName = profile_json['name']
lockedAccount = getLockedAccount(profile_json) lockedAccount = get_locked_account(profile_json)
if lockedAccount: if lockedAccount:
displayName += '🔒' displayName += '🔒'
movedTo = '' movedTo = ''