From 7241d5def8e838ccbb3c6f54ae3cafb6ed86b93c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 6 Nov 2019 11:57:43 +0000 Subject: [PATCH] Check for snooze file --- person.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/person.py b/person.py index d85c9ec58..d84c402eb 100644 --- a/person.py +++ b/person.py @@ -798,8 +798,9 @@ def personSnooze(baseDir: str,nickname: str,domain: str,snoozeActor: str) -> Non print('ERROR: unknown account '+accountDir) return snoozedFilename=accountDir+'/snoozed.txt' - if snoozeActor+' ' in open(snoozedFilename).read(): - return + if os.path.isfile(snoozedFilename): + if snoozeActor+' ' in open(snoozedFilename).read(): + return snoozedFile=open(snoozedFilename, "a+") if snoozedFile: snoozedFile.write(snoozeActor+' '+str(int(time.time()))+'\n')