This was a very simple update. The gmg command `adduser` was generating an
authortilly-Q <nattilypigeonfowl@gmail.com>
Sun, 29 Sep 2013 18:34:41 +0000 (14:34 -0400)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 10 Jul 2014 15:28:34 +0000 (10:28 -0500)
unncessary error because we were searching for a non-unicode string value in a
Unicode column of the core__users table.

mediagoblin/gmg_commands/users.py

index 186557e09d88822ac9391c98f73a2c5318e1be9b..71149497b2aa81f18a444185f2bfc2c739a4ed5a 100644 (file)
@@ -34,7 +34,7 @@ def adduser(args):
     #TODO: Lets trust admins this do not validate Emails :)
     commands_util.setup_app(args)
 
-    args.username = commands_util.prompt_if_not_set(args.username, "Username:")
+    args.username = unicode(commands_util.prompt_if_not_set(args.username, "Username:"))
     args.password = commands_util.prompt_if_not_set(args.password, "Password:",True)
     args.email = commands_util.prompt_if_not_set(args.email, "Email:")
 
@@ -50,7 +50,7 @@ def adduser(args):
     else:
         # Create the user
         entry = db.User()
-        entry.username = unicode(args.username.lower())
+        entry.username = args.username.lower()
         entry.email = unicode(args.email)
         entry.pw_hash = auth.gen_password_hash(args.password)
         default_privileges = [