summaryrefslogtreecommitdiffstats
path: root/accounts/models.py
diff options
context:
space:
mode:
authorVincent Post <cent@spline.de>2020-08-07 16:57:39 +0200
committerVincent Post <cent@spline.de>2020-08-07 16:57:39 +0200
commitf0a3dfd28d14461caeece9d7c171b6b319049c77 (patch)
tree3dbc76253a78607f1cdfe36d72c5b93e6a66baf8 /accounts/models.py
parent1db4f84c5adb2e33ea8d065cb6bcb0e7eeedc02f (diff)
downloadweb-f0a3dfd28d14461caeece9d7c171b6b319049c77.tar.gz
web-f0a3dfd28d14461caeece9d7c171b6b319049c77.tar.bz2
web-f0a3dfd28d14461caeece9d7c171b6b319049c77.zip
2to3 -w accounts contrib
Diffstat (limited to 'accounts/models.py')
-rw-r--r--accounts/models.py12
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