From 396556f6e9c5bb1d9fe8ecc9d71419c86993897f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 17 Dec 2020 16:57:47 +0000 Subject: [PATCH] Indexes --- daemon.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/daemon.py b/daemon.py index 5dd44808d..5126220c4 100644 --- a/daemon.py +++ b/daemon.py @@ -5589,9 +5589,11 @@ class PubServer(BaseHTTPRequestHandler): if newswire.get(dateStr): if isModerator(baseDir, nickname): print('Voting on newswire item: ' + str(newswire[dateStr])) - if 'vote:' + nickname not in newswire[dateStr][2]: - newswire[dateStr][2].append('vote:' + nickname) - filename = newswire[dateStr][3] + votesIndex = 2 + filenameIndex = 3 + if 'vote:' + nickname not in newswire[dateStr][votesIndex]: + newswire[dateStr][votesIndex].append('vote:' + nickname) + filename = newswire[dateStr][filenameIndex] newswireStateFilename = \ baseDir + '/accounts/.newswirestate.json' try: @@ -5599,7 +5601,7 @@ class PubServer(BaseHTTPRequestHandler): except Exception as e: print('ERROR saving newswire state, ' + str(e)) if filename: - saveJson(newswire[dateStr][2], + saveJson(newswire[dateStr][votesIndex], filename + '.votes') originPathStrAbsolute = \