aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/gmg_commands/users.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-06-02 20:59:28 +0300
committerBerker Peksag <berker.peksag@gmail.com>2014-06-02 20:59:28 +0300
commite49b7e02b2150413d2e78db709277fae0887be46 (patch)
tree6c39946f2b4aca080c75274f97ec263f793ae012 /mediagoblin/gmg_commands/users.py
parenta80c74bbcc6ac0208cfef725a441810a29876cff (diff)
downloadmediagoblin-e49b7e02b2150413d2e78db709277fae0887be46.tar.lz
mediagoblin-e49b7e02b2150413d2e78db709277fae0887be46.tar.xz
mediagoblin-e49b7e02b2150413d2e78db709277fae0887be46.zip
Use six.text_type instead of unicode().
I will be switch to use ``from __future__ import unicode_literals`` later.
Diffstat (limited to 'mediagoblin/gmg_commands/users.py')
-rw-r--r--mediagoblin/gmg_commands/users.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/mediagoblin/gmg_commands/users.py b/mediagoblin/gmg_commands/users.py
index 4a730d9e..9014da87 100644
--- a/mediagoblin/gmg_commands/users.py
+++ b/mediagoblin/gmg_commands/users.py
@@ -14,6 +14,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import six
+
from mediagoblin.gmg_commands import util as commands_util
from mediagoblin import auth
from mediagoblin import mg_globals
@@ -50,8 +52,8 @@ def adduser(args):
else:
# Create the user
entry = db.User()
- entry.username = unicode(args.username.lower())
- entry.email = unicode(args.email)
+ entry.username = six.text_type(args.username.lower())
+ entry.email = six.text_type(args.email)
entry.pw_hash = auth.gen_password_hash(args.password)
default_privileges = [
db.Privilege.query.filter(
@@ -81,7 +83,7 @@ def makeadmin(args):
db = mg_globals.database
user = db.User.query.filter_by(
- username=unicode(args.username.lower())).one()
+ username=six.text_type(args.username.lower())).one()
if user:
user.all_privileges.append(
db.Privilege.query.filter(
@@ -108,7 +110,7 @@ def changepw(args):
db = mg_globals.database
user = db.User.query.filter_by(
- username=unicode(args.username.lower())).one()
+ username=six.text_type(args.username.lower())).one()
if user:
user.pw_hash = auth.gen_password_hash(args.password)
user.save()