diff --git a/app/activitypub/signature.py b/app/activitypub/signature.py index 65bf4c5a..9bac1e3a 100644 --- a/app/activitypub/signature.py +++ b/app/activitypub/signature.py @@ -92,7 +92,7 @@ def post_request(uri: str, body: dict | None, private_key: str, key_id: str, con body['@context'] = default_context() type = body['type'] if 'type' in body else '' log = ActivityPubLog(direction='out', activity_type=type, result='processing', activity_id=body['id'], exception_message='') - log.activity_json=json.dumps(body) + log.activity_json = json.dumps(body) db.session.add(log) db.session.commit() @@ -107,7 +107,8 @@ def post_request(uri: str, body: dict | None, private_key: str, key_id: str, con log.exception_message = f'{result.status_code}: {result.text:.100}' + ' - ' if 'DOCTYPE html' in result.text: log.result = 'ignored' - log.exception_message = f'{result.status_code}: HTML instead of JSON response - ' + log.exception_message = f'{result.status_code}: HTML instead of JSON response - ' + log.activity_json += result.text elif 'community_has_no_followers' in result.text: fix_local_community_membership(uri, private_key) else: