forked from indymedia/epicyon
Show locked account status after search for handle
parent
74547ca8d9
commit
a9fcabd366
|
@ -47,7 +47,6 @@ from matrix import getMatrixAddress
|
||||||
from matrix import setMatrixAddress
|
from matrix import setMatrixAddress
|
||||||
from donate import getDonationUrl
|
from donate import getDonationUrl
|
||||||
from donate import setDonationUrl
|
from donate import setDonationUrl
|
||||||
from person import getLockedAccount
|
|
||||||
from person import setPersonNotes
|
from person import setPersonNotes
|
||||||
from person import getDefaultPersonContext
|
from person import getDefaultPersonContext
|
||||||
from person import savePersonQrcode
|
from person import savePersonQrcode
|
||||||
|
@ -178,6 +177,7 @@ from shares import addShare
|
||||||
from shares import removeShare
|
from shares import removeShare
|
||||||
from shares import expireShares
|
from shares import expireShares
|
||||||
from categories import setHashtagCategory
|
from categories import setHashtagCategory
|
||||||
|
from utils import getLockedAccount
|
||||||
from utils import hasUsersPath
|
from utils import hasUsersPath
|
||||||
from utils import getFullDomain
|
from utils import getFullDomain
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
|
|
10
person.py
10
person.py
|
@ -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,
|
def _createPersonBase(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
httpPrefix: str, saveToFile: bool,
|
httpPrefix: str, saveToFile: bool,
|
||||||
manualFollowerApproval: bool,
|
manualFollowerApproval: bool,
|
||||||
|
|
10
utils.py
10
utils.py
|
@ -19,6 +19,16 @@ from calendar import monthrange
|
||||||
from followingCalendar import addPersonToCalendar
|
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:
|
def hasUsersPath(pathStr: str) -> bool:
|
||||||
"""Whether there is a /users/ path (or equivalent) in the given string
|
"""Whether there is a /users/ path (or equivalent) in the given string
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -8,6 +8,7 @@ __status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
from utils import getLockedAccount
|
||||||
from utils import hasUsersPath
|
from utils import hasUsersPath
|
||||||
from utils import getFullDomain
|
from utils import getFullDomain
|
||||||
from utils import isDormant
|
from utils import isDormant
|
||||||
|
@ -164,6 +165,11 @@ def htmlProfileAfterSearch(cssCache: {},
|
||||||
displayName = searchNickname
|
displayName = searchNickname
|
||||||
if profileJson.get('name'):
|
if profileJson.get('name'):
|
||||||
displayName = profileJson['name']
|
displayName = profileJson['name']
|
||||||
|
|
||||||
|
lockedAccount = getLockedAccount(profileJson)
|
||||||
|
if lockedAccount:
|
||||||
|
displayName += '🔒'
|
||||||
|
|
||||||
profileDescription = ''
|
profileDescription = ''
|
||||||
if profileJson.get('summary'):
|
if profileJson.get('summary'):
|
||||||
profileDescription = profileJson['summary']
|
profileDescription = profileJson['summary']
|
||||||
|
|
Loading…
Reference in New Issue