diff --git a/app/activitypub/routes.py b/app/activitypub/routes.py index fab4bb1a..ae856fe6 100644 --- a/app/activitypub/routes.py +++ b/app/activitypub/routes.py @@ -431,6 +431,8 @@ def process_inbox_request(request_json, activitypublog_id, ip_address): if user is None: activity_log.exception_message = 'Blocked or unfound user' + elif liked is None: + activity_log.exception_message = 'Unfound object' elif user.is_local(): activity_log.exception_message = 'Activity about local content which is already present' activity_log.result = 'ignored' @@ -465,6 +467,8 @@ def process_inbox_request(request_json, activitypublog_id, ip_address): disliked = find_liked_object(liked_ap_id) if user is None: activity_log.exception_message = 'Blocked or unfound user' + elif disliked is None: + activity_log.exception_message = 'Unfound object' elif user.is_local(): activity_log.exception_message = 'Activity about local content which is already present' activity_log.result = 'ignored' @@ -641,6 +645,8 @@ def process_inbox_request(request_json, activitypublog_id, ip_address): liked = find_liked_object(request_json['object']) if user is None: activity_log.exception_message = 'Blocked or unfound user' + elif liked is None: + activity_log.exception_message = 'Unfound object' elif user.is_local(): activity_log.exception_message = 'Activity about local content which is already present' activity_log.result = 'ignored' @@ -674,6 +680,8 @@ def process_inbox_request(request_json, activitypublog_id, ip_address): disliked = find_liked_object(target_ap_id) if user is None: activity_log.exception_message = 'Blocked or unfound user' + elif disliked is None: + activity_log.exception_message = 'Unfound object' elif user.is_local(): activity_log.exception_message = 'Activity about local content which is already present' activity_log.result = 'ignored'