mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
41d8c2edde
commit
65e42a7c12
|
@ -270,7 +270,7 @@ from utils import loadTranslationsFromFile
|
|||
from utils import getLocalNetworkAddresses
|
||||
from utils import decodedHost
|
||||
from utils import isPublicPost
|
||||
from utils import getLockedAccount
|
||||
from utils import get_locked_account
|
||||
from utils import hasUsersPath
|
||||
from utils import getFullDomain
|
||||
from utils import removeHtml
|
||||
|
@ -7116,7 +7116,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
movedTo = movedTo.split('"')[1]
|
||||
if actor_json['type'] == 'Group':
|
||||
isGroup = True
|
||||
lockedAccount = getLockedAccount(actor_json)
|
||||
lockedAccount = get_locked_account(actor_json)
|
||||
donateUrl = getDonationUrl(actor_json)
|
||||
websiteUrl = getWebsite(actor_json, self.server.translate)
|
||||
xmppAddress = getXmppAddress(actor_json)
|
||||
|
|
6
utils.py
6
utils.py
|
@ -157,7 +157,7 @@ def get_sha_512(msg: str):
|
|||
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
|
||||
"""
|
||||
if host.startswith('localhost') or \
|
||||
|
@ -174,14 +174,14 @@ def decodedHost(host: str) -> str:
|
|||
"""
|
||||
if ':' not in host:
|
||||
# eg. mydomain:8000
|
||||
if not _localNetworkHost(host):
|
||||
if not _local_network_host(host):
|
||||
if not host.endswith('.onion'):
|
||||
if not host.endswith('.i2p'):
|
||||
return idna.decode(host)
|
||||
return host
|
||||
|
||||
|
||||
def getLockedAccount(actor_json: {}) -> bool:
|
||||
def get_locked_account(actor_json: {}) -> bool:
|
||||
"""Returns whether the given account requires follower approval
|
||||
"""
|
||||
if not actor_json.get('manuallyApprovesFollowers'):
|
||||
|
|
|
@ -14,7 +14,7 @@ from utils import getDisplayName
|
|||
from utils import isGroupAccount
|
||||
from utils import has_object_dict
|
||||
from utils import getOccupationName
|
||||
from utils import getLockedAccount
|
||||
from utils import get_locked_account
|
||||
from utils import getFullDomain
|
||||
from utils import isArtist
|
||||
from utils import isDormant
|
||||
|
@ -185,7 +185,7 @@ def htmlProfileAfterSearch(cssCache: {},
|
|||
if profile_json.get('name'):
|
||||
displayName = profile_json['name']
|
||||
|
||||
lockedAccount = getLockedAccount(profile_json)
|
||||
lockedAccount = get_locked_account(profile_json)
|
||||
if lockedAccount:
|
||||
displayName += '🔒'
|
||||
movedTo = ''
|
||||
|
|
Loading…
Reference in New Issue