Add windows fixes

This commit is contained in:
2020-04-25 22:08:59 +01:00
parent b9cefcc111
commit 5b767da91f
4 changed files with 245 additions and 3 deletions

View File

@@ -33,9 +33,10 @@ class Handler(FileSystemEventHandler):
def on_any_event(event):
if event.is_directory:
return None
elif (event.event_type == 'modified' and
elif (event.event_type == 'created' and
'passwordreset' in event.src_path):
log.debug(f'Password reset file: {event.src_path}')
time.sleep(1)
with open(event.src_path, 'r') as f:
reset = json.load(f)
log.info(f'New password reset for {reset["UserName"]}')