Check that questions file exists

main
Bob Mottram 2019-11-27 09:58:39 +00:00
parent 079095341a
commit 9fc251c11f
1 changed files with 5 additions and 4 deletions

View File

@ -194,10 +194,11 @@ class PubServer(BaseHTTPRequestHandler):
self.server.baseDir+'/accounts/'+ \
nickname+'@'+self.server.domain+'/questions.txt'
# have we already voted on this?
if messageId in open(votesFilename).read():
print('Already voted on message '+messageId)
return
if os.path.isfile(votesFilename):
# have we already voted on this?
if messageId in open(votesFilename).read():
print('Already voted on message '+messageId)
return
print('Voting on message '+messageId)
print('Vote for: '+answer)