From f0e795df82596e476d9f116d58012e563bb064a4 Mon Sep 17 00:00:00 2001 From: ayleph Date: Tue, 16 Sep 2014 15:29:09 -0700 Subject: [PATCH] Modify deleteuser to fail gracefully bin/gmg deleteuser will produce a traceback error if you attempt to delete a user who does not exist. This commit provides a fix to allow deletuser to fail gracefully. This commit addresses https://issues.mediagoblin.org/ticket/969 --- mediagoblin/gmg_commands/users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/gmg_commands/users.py b/mediagoblin/gmg_commands/users.py index 71149497..d34f50e2 100644 --- a/mediagoblin/gmg_commands/users.py +++ b/mediagoblin/gmg_commands/users.py @@ -129,7 +129,7 @@ def deleteuser(args): db = mg_globals.database user = db.User.query.filter_by( - username=unicode(args.username.lower())).one() + username=unicode(args.username.lower())).first() if user: user.delete() print 'The user %s has been deleted' % args.username -- 2.25.1