Checking questions file

main
Bob Mottram 2019-11-26 20:22:52 +00:00
parent 84bee5201a
commit 62c71d03c9
1 changed files with 7 additions and 2 deletions

View File

@ -1795,8 +1795,13 @@ def insertQuestion(baseDir: str,translate: {}, \
votesFilename= \ votesFilename= \
baseDir+'/accounts/'+nickname+'@'+domain+'/questions.txt' baseDir+'/accounts/'+nickname+'@'+domain+'/questions.txt'
if messageId not in open(votesFilename).read(): showQuestion=True
if os.path.isfile(votesFilename):
if messageId not in open(votesFilename).read():
showQuestion=False
if showQuestion:
# show the question options # show the question options
content+='<div class="question">' content+='<div class="question">'
content+='<form method="POST" action="/users/'+nickname+'/question'+pageNumberStr+'">' content+='<form method="POST" action="/users/'+nickname+'/question'+pageNumberStr+'">'