Only print with debug

merge-requests/30/head
Bob Mottram 2021-03-11 11:41:14 +00:00
parent 32baf6b41f
commit 85897ca526
1 changed files with 5 additions and 3 deletions

View File

@ -254,8 +254,9 @@ def sendUndoLikeViaServer(baseDir: str, session,
print('DEBUG: announce webfinger failed for ' + handle) print('DEBUG: announce webfinger failed for ' + handle)
return 1 return 1
if not isinstance(wfRequest, dict): if not isinstance(wfRequest, dict):
print('WARN: Webfinger for ' + handle + ' did not return a dict. ' + if debug:
str(wfRequest)) print('WARN: Webfinger for ' + handle +
' did not return a dict. ' + str(wfRequest))
return 1 return 1
postToBox = 'outbox' postToBox = 'outbox'
@ -287,7 +288,8 @@ def sendUndoLikeViaServer(baseDir: str, session,
postResult = postJson(session, newUndoLikeJson, [], inboxUrl, postResult = postJson(session, newUndoLikeJson, [], inboxUrl,
headers, 30, True) headers, 30, True)
if not postResult: if not postResult:
print('WARN: POST announce failed for c2s to ' + inboxUrl) if debug:
print('WARN: POST announce failed for c2s to ' + inboxUrl)
return 5 return 5
if debug: if debug: