diff --git a/daemon.py b/daemon.py index 276bf666..694a1bb7 100644 --- a/daemon.py +++ b/daemon.py @@ -6004,8 +6004,7 @@ class PubServer(BaseHTTPRequestHandler): searchStr = searchStr.replace('+', ' ') searchStr = \ urllib.parse.unquote(searchStr.strip()) - if self.server.debug: - print('searchStr: ' + searchStr) + print('searchStr: ' + searchStr) if searchForEmoji: searchStr = ':' + searchStr + ':' if searchStr.startswith('#'): diff --git a/webfinger.py b/webfinger.py index 34e7f54d..73024fd0 100644 --- a/webfinger.py +++ b/webfinger.py @@ -44,6 +44,8 @@ def parseHandle(handle: str) -> (str, str): def webfingerHandle(session, handle: str, httpPrefix: str, cachedWebfingers: {}, fromDomain: str, projectVersion: str) -> {}: + """ + """ if not session: print('WARN: No session specified for webfingerHandle') return None @@ -81,8 +83,10 @@ def webfingerHandle(session, handle: str, httpPrefix: str, print('params: ' + str(par)) print(e) return None - storeWebfingerInCache(nickname + '@' + wfDomain, - result, cachedWebfingers) + + if result: + storeWebfingerInCache(nickname + '@' + wfDomain, + result, cachedWebfingers) return result diff --git a/webinterface.py b/webinterface.py index fca8c8f7..6a917f61 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5846,9 +5846,8 @@ def htmlProfileAfterSearch(recentPostsCache: {}, maxRecentPosts: int, httpPrefix, wfRequest, domain, projectVersion) if not wf: - if debug: - print('DEBUG: Unable to webfinger ' + - searchNickname + '@' + searchDomainFull) + print('DEBUG: Unable to webfinger ' + + searchNickname + '@' + searchDomainFull) return None personUrl = None if wf.get('errors'): @@ -5878,8 +5877,7 @@ def htmlProfileAfterSearch(recentPostsCache: {}, maxRecentPosts: int, getJson(session, personUrl, asHeader, None, projectVersion, httpPrefix, domain) if not profileJson: - if debug: - print('DEBUG: No actor returned from ' + personUrl) + print('DEBUG: No actor returned from ' + personUrl) return None avatarUrl = '' if profileJson.get('icon'):