Show locked account status after search for handle

main
Bob Mottram 2021-01-02 11:18:43 +00:00
parent 74547ca8d9
commit a9fcabd366
4 changed files with 17 additions and 11 deletions

View File

@ -47,7 +47,6 @@ from matrix import getMatrixAddress
from matrix import setMatrixAddress
from donate import getDonationUrl
from donate import setDonationUrl
from person import getLockedAccount
from person import setPersonNotes
from person import getDefaultPersonContext
from person import savePersonQrcode
@ -178,6 +177,7 @@ from shares import addShare
from shares import removeShare
from shares import expireShares
from categories import setHashtagCategory
from utils import getLockedAccount
from utils import hasUsersPath
from utils import getFullDomain
from utils import removeHtml

View File

@ -201,16 +201,6 @@ def getDefaultPersonContext() -> str:
}
def getLockedAccount(actorJson: {}) -> bool:
"""Returns whether the given account requires follower approval
"""
if not actorJson.get('manuallyApprovesFollowers'):
return False
if actorJson['manuallyApprovesFollowers'] is True:
return True
return False
def _createPersonBase(baseDir: str, nickname: str, domain: str, port: int,
httpPrefix: str, saveToFile: bool,
manualFollowerApproval: bool,

View File

@ -19,6 +19,16 @@ from calendar import monthrange
from followingCalendar import addPersonToCalendar
def getLockedAccount(actorJson: {}) -> bool:
"""Returns whether the given account requires follower approval
"""
if not actorJson.get('manuallyApprovesFollowers'):
return False
if actorJson['manuallyApprovesFollowers'] is True:
return True
return False
def hasUsersPath(pathStr: str) -> bool:
"""Whether there is a /users/ path (or equivalent) in the given string
"""

View File

@ -8,6 +8,7 @@ __status__ = "Production"
import os
from pprint import pprint
from utils import getLockedAccount
from utils import hasUsersPath
from utils import getFullDomain
from utils import isDormant
@ -164,6 +165,11 @@ def htmlProfileAfterSearch(cssCache: {},
displayName = searchNickname
if profileJson.get('name'):
displayName = profileJson['name']
lockedAccount = getLockedAccount(profileJson)
if lockedAccount:
displayName += '🔒'
profileDescription = ''
if profileJson.get('summary'):
profileDescription = profileJson['summary']