From 6a9ba43936fbb89ae898870b6b0b652c756d8d32 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:42:10 +1300 Subject: [PATCH] sometimes ap_id is a dict?! --- app/activitypub/routes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/activitypub/routes.py b/app/activitypub/routes.py index 1bfe6ae5..9c926b14 100644 --- a/app/activitypub/routes.py +++ b/app/activitypub/routes.py @@ -1610,6 +1610,8 @@ def process_new_content(user, community, store_ap_json, request_json, announced= def process_upvote(user, store_ap_json, request_json, announced=True): id = request_json['id'] ap_id = request_json['object'] if not announced else request_json['object']['object'] + if isinstance(ap_id, dict) and 'id' in ap_id: + ap_id = ap_id['id'] liked = find_liked_object(ap_id) if liked is None: log_incoming_ap(id, APLOG_LIKE, APLOG_FAILURE, request_json if store_ap_json else None, 'Unfound object ' + ap_id)