sometimes ap_id is a dict?!

This commit is contained in:
rimu 2024-12-05 15:42:10 +13:00
parent 69cef6edac
commit 6a9ba43936

View file

@ -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)