sometimes ap_id is a dict?!

This commit is contained in:
rimu 2024-12-05 15:42:58 +13:00
parent 6a9ba43936
commit 6cc6fceb5b

View file

@ -1629,6 +1629,8 @@ def process_upvote(user, store_ap_json, request_json, announced=True):
def process_downvote(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_DISLIKE, APLOG_FAILURE, request_json if store_ap_json else None, 'Unfound object ' + ap_id)