mirror of https://gitlab.com/bashrc2/epicyon
Ensure that question html gets regenerated after vote
parent
50319d153c
commit
2aead37e5c
14
inbox.py
14
inbox.py
|
@ -913,7 +913,6 @@ def _receiveUpdateToQuestion(recentPostsCache: {}, messageJson: {},
|
|||
except BaseException:
|
||||
print('EX: _receiveUpdateToQuestion unable to delete ' +
|
||||
cachedPostFilename)
|
||||
pass
|
||||
# remove from memory cache
|
||||
removePostFromCache(messageJson, recentPostsCache)
|
||||
|
||||
|
@ -2792,10 +2791,21 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
|||
questionJson, questionPostFilename = \
|
||||
questionUpdateVotes(baseDir, nickname, domain, postJsonObject)
|
||||
if questionJson and questionPostFilename:
|
||||
removePostFromCache(postJsonObject, recentPostsCache)
|
||||
removePostFromCache(questionJson, recentPostsCache)
|
||||
# add id to inbox index
|
||||
inboxUpdateIndex('inbox', baseDir, handle,
|
||||
questionPostFilename, debug)
|
||||
# ensure that the cached post is removed if it exists, so
|
||||
# that it then will be recreated
|
||||
cachedPostFilename = \
|
||||
getCachedPostFilename(baseDir, nickname, domain, questionJson)
|
||||
if cachedPostFilename:
|
||||
if os.path.isfile(cachedPostFilename):
|
||||
try:
|
||||
os.remove(cachedPostFilename)
|
||||
except BaseException:
|
||||
print('EX: replytoQuestion unable to delete ' +
|
||||
cachedPostFilename)
|
||||
# Is this a question created by this instance?
|
||||
idPrefix = httpPrefix + '://' + domain
|
||||
if questionJson['object']['id'].startswith(idPrefix):
|
||||
|
|
Loading…
Reference in New Issue