summaryrefslogtreecommitdiffstats
path: root/accounts/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/models.py')
-rw-r--r--accounts/models.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/accounts/models.py b/accounts/models.py
index 40db977..aa0e4d0 100644
--- a/accounts/models.py
+++ b/accounts/models.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-
from flask.ext.login import UserMixin
from accounts.utils.login import create_userid
@@ -13,9 +11,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, str) else uid
+ self.uid = uid
self.services = list() if services is None else services
- self.password = password.encode('utf8') if isinstance(password, str) else password
+ self.password = password
self.new_password_root = None
self.new_password_services = {}
self.attributes = {}
@@ -37,21 +35,12 @@ class Account(UserMixin):
the root password will be changed.
"""
- if isinstance(new_password, str):
- new_password = new_password.encode('utf8')
-
- if isinstance(old_password, str):
- old_password = old_password.encode('utf8')
-
if not service:
self.new_password_root = (old_password, new_password)
else:
self.new_password_services[service] = (old_password, new_password)
def _set_attribute(self, key, value):
- if isinstance(value, str):
- value = value.encode('utf8')
-
self.attributes[key] = value
def change_email(self, new_mail):