From: Jessica Tallon Date: Tue, 20 Jan 2015 10:49:24 +0000 (+0000) Subject: Let parser handle typing for deletuser command X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a02de38f9105bd6ffa54133d4b1ccdd33ec34034;p=mediagoblin.git Let parser handle typing for deletuser command --- 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)