From 085ac63da8097cc749646897d8d37df825090d04 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Mon, 20 Jan 2020 17:23:48 -0800 Subject: [PATCH] Fix user-delete --- amanuensis/cli/user.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/amanuensis/cli/user.py b/amanuensis/cli/user.py index 3697d91..f96ecdc 100644 --- a/amanuensis/cli/user.py +++ b/amanuensis/cli/user.py @@ -1,3 +1,5 @@ +import shutil + from cli.helpers import ( add_argument, no_argument, requires_username, config_get, config_set, CONFIG_GET_ROOT_VALUE) @@ -42,14 +44,14 @@ def command_delete(args): import config - user_path = config.prepend('user', args.uid) + user_path = config.prepend('user', args.id) if not os.path.isdir(user_path): config.logger.error("No user with that id") return -1 else: - os.remove(user_path) + shutil.rmtree(user_path) with config.json_rw('user', 'index.json') as j: - if args.uid in j: + if args.id in j: del j[uid] @no_argument