Check that published is defined

merge-requests/30/head
Bob Mottram 2025-01-22 15:52:46 +00:00
parent a1d95eafe6
commit e7bd906a1b
1 changed files with 4 additions and 0 deletions

View File

@ -552,6 +552,7 @@ def save_post_to_inbox_queue(base_dir: str, http_prefix: str,
curr_time = date_utcnow()
post_id = None
published = ''
if post_json_object.get('id'):
post_id = remove_id_ending(post_json_object['id'])
published = curr_time.strftime("%Y-%m-%dT%H:%M:%SZ")
@ -564,6 +565,9 @@ def save_post_to_inbox_queue(base_dir: str, http_prefix: str,
local_actor_url(http_prefix, nickname, original_domain) + \
'/statuses/' + status_number
if not published:
return None
# NOTE: don't change post_json_object['id'] before signature check
inbox_queue_dir = create_inbox_queue_dir(nickname, domain, base_dir)