From cbdd2357c5bc0abb5343c67296746872cb0b32a9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 6 Nov 2020 12:06:41 +0000 Subject: [PATCH] Allow for citations to be removed --- daemon.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index 8073a51f3..4b58b4c24 100644 --- a/daemon.py +++ b/daemon.py @@ -3058,6 +3058,13 @@ class PubServer(BaseHTTPRequestHandler): """Updates the citations for a blog post after hitting update button on the citations screen """ + citationsFilename = \ + baseDir + '/accounts/' + \ + nickname + '@' + domain + '/.citations.txt' + # remove any existing citations file + if os.path.isfile(citationsFilename): + os.remove(citationsFilename) + usersPath = path.replace('/citationsdata', '') actorStr = httpPrefix + '://' + domainFull + usersPath if newswire and \ @@ -3122,9 +3129,6 @@ class PubServer(BaseHTTPRequestHandler): citations.append(fields[fieldName]) if citations: - citationsFilename = \ - baseDir + '/accounts/' + \ - nickname + '@' + domain + '/.citations.txt' citationsStr = '' for citationDate in citations: citationsStr += citationDate + '\n'