From a02de38f9105bd6ffa54133d4b1ccdd33ec34034 Mon Sep 17 00:00:00 2001 From: Jessica Tallon Date: Tue, 20 Jan 2015 10:49:24 +0000 Subject: [PATCH] Let parser handle typing for deletuser command --- mediagoblin/gmg_commands/users.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mediagoblin/gmg_commands/users.py b/mediagoblin/gmg_commands/users.py index 63c48690..158a1a2d 100644 --- a/mediagoblin/gmg_commands/users.py +++ b/mediagoblin/gmg_commands/users.py @@ -124,7 +124,8 @@ def changepw(args): def deleteuser_parser_setup(subparser): subparser.add_argument( 'username', - help="Username to delete") + help="Username to delete", + type=six.text_type) def deleteuser(args): @@ -132,8 +133,7 @@ def deleteuser(args): db = mg_globals.database - user = db.User.query.filter_by( - username=unicode(args.username.lower())).first() + user = db.User.query.filter_by(username=args.username.lower()).first() if user: user.delete() print('The user %s has been deleted' % args.username) -- 2.25.1