From 62c71d03c97a637a2744e3a3c99c421533669df5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 26 Nov 2019 20:22:52 +0000 Subject: [PATCH] Checking questions file --- webinterface.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webinterface.py b/webinterface.py index 975370d4..0b8b3476 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1795,8 +1795,13 @@ def insertQuestion(baseDir: str,translate: {}, \ votesFilename= \ 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 content+='
' content+='
'