diff options
Diffstat (limited to 'accounts/models.py')
-rw-r--r-- | accounts/models.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/accounts/models.py b/accounts/models.py index 82dab45..40db977 100644 --- a/accounts/models.py +++ b/accounts/models.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import + from flask.ext.login import UserMixin from accounts.utils.login import create_userid @@ -13,9 +13,9 @@ class Account(UserMixin): _ready = False def __init__(self, uid, mail, services=None, password=None, uidNumber=None): - self.uid = uid.encode('utf8') if isinstance(uid, unicode) else uid + self.uid = uid.encode('utf8') if isinstance(uid, str) else uid self.services = list() if services is None else services - self.password = password.encode('utf8') if isinstance(password, unicode) else password + self.password = password.encode('utf8') if isinstance(password, str) else password self.new_password_root = None self.new_password_services = {} self.attributes = {} @@ -37,10 +37,10 @@ class Account(UserMixin): the root password will be changed. """ - if isinstance(new_password, unicode): + if isinstance(new_password, str): new_password = new_password.encode('utf8') - if isinstance(old_password, unicode): + if isinstance(old_password, str): old_password = old_password.encode('utf8') if not service: @@ -49,7 +49,7 @@ class Account(UserMixin): self.new_password_services[service] = (old_password, new_password) def _set_attribute(self, key, value): - if isinstance(value, unicode): + if isinstance(value, str): value = value.encode('utf8') self.attributes[key] = value |