diff --git a/federation/entities/activitypub/mappers.py b/federation/entities/activitypub/mappers.py index 5ccc37d..7e46a63 100644 --- a/federation/entities/activitypub/mappers.py +++ b/federation/entities/activitypub/mappers.py @@ -201,8 +201,7 @@ def get_outbound_entity(entity: BaseEntity, private_key): # # in all situations but is apparently being removed. # # TODO: remove this once Diaspora removes the extra signature # outbound.parent_signature = outbound.signature - if getattr(outbound, "pre_send", None) and isinstance(getattr(outbound, "pre_send"), callable): - # noinspection PyUnresolvedReferences + if hasattr(outbound, "pre_send"): outbound.pre_send() return outbound diff --git a/federation/outbound.py b/federation/outbound.py index 12d9f1d..ab46301 100644 --- a/federation/outbound.py +++ b/federation/outbound.py @@ -153,7 +153,7 @@ def handle_send( payload["object"]["to"] = [fid] payload = json.dumps(payload).encode("utf-8") except Exception as ex: - logger.error("handle_send - failed to generate private payload for %s: %s", fid, ex) + logger.error("handle_send - failed to generate payload for %s, %s: %s", fid, endpoint, ex) continue payloads.append({ "auth": get_http_authentication(author_user.private_key, f"{author_user.id}#main-key"),