Create post_url if missing

merge-requests/30/head
Bob Mottram 2024-10-23 14:02:25 +01:00
parent 2e5d9c4c6f
commit e4db3ccc40
1 changed files with 4 additions and 0 deletions

View File

@ -3553,6 +3553,7 @@ def reject_post_id(base_dir: str, nickname: str, domain: str,
if not post_filename:
return
post_url = None
if recent_posts_cache.get('index'):
# if this is a full path then remove the directories
index_filename = post_filename
@ -3582,6 +3583,9 @@ def reject_post_id(base_dir: str, nickname: str, domain: str,
# if the post is in the inbox index then remove it
index_file = \
acct_dir(base_dir, nickname, domain) + '/inbox.index'
if not post_url:
post_url = remove_eol(index_filename)
post_url = post_url.replace('.json', '').strip()
post_url2 = post_url.replace('/', '#') + '.json'
remove_post_from_index(post_url2, debug, index_file)