From 99ed86566d5121d3a5322c6cdfaa566a78274828 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 22 Aug 2019 14:29:57 +0100 Subject: [PATCH] Sequence --- utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.py b/utils.py index 6bd6d307..38ddeddb 100644 --- a/utils.py +++ b/utils.py @@ -64,10 +64,10 @@ def urlPermitted(url: str, federationList: [],capability: str): def getPreferredName(actor: str,personCache: {}) -> str: """Returns the preferred name for the given actor """ - if not personCache.get(actor): - return None if '/statuses/' in actor: actor=actor.split('/statuses/')[0] + if not personCache.get(actor): + return None if personCache[actor].get('actor'): if personCache[actor]['actor'].get('preferredUsername'): return personCache[actor]['actor']['preferredUsername']