forked from indymedia/epicyon
Show locked account status after search for handle
This commit is contained in:
1 parent
74547ca8d9
commit
a9fcabd366
4 files changed
+17
-11
No files matched your search
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
"""
|
||||
|
||||
@@ -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']
|
||||
|
||||
Reference in new issue
Block a user