From 6ed8f89c04acfa75d80f6809c9ce6603d42d2068 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 12 Jan 2020 20:53:00 +0000 Subject: [PATCH] Always create file for scheduled posts --- posts.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/posts.py b/posts.py index efc4bdfb..cb8c716c 100644 --- a/posts.py +++ b/posts.py @@ -717,18 +717,18 @@ def createPostBase(baseDir: str,nickname: str,domain: str,port: int, \ modFile.write(newPostId+'\n') modFile.close() - if saveToFile: - outboxName='outbox' - if schedulePost: - if eventDate and eventTime: - outboxName='scheduled' - # add an item to the scheduled post index file - addSchedulePost(baseDir,nickname,domain,eventDateStr,postId) - else: - print('Unable to create scheduled post without date and time values') - return newPost + if schedulePost: + if eventDate and eventTime: + # add an item to the scheduled post index file + addSchedulePost(baseDir,nickname,domain,eventDateStr,postId) + savePostToBox(baseDir,httpPrefix,newPostId, \ + nickname,domain,newPost,'scheduled') + else: + print('Unable to create scheduled post without date and time values') + return newPost + elif saveToFile: savePostToBox(baseDir,httpPrefix,newPostId, \ - nickname,domain,newPost,outboxName) + nickname,domain,newPost,'outbox') return newPost def outboxMessageCreateWrap(httpPrefix: str, \