diff options
author | Vincent Post <cent@spline.de> | 2020-08-07 18:16:57 +0200 |
---|---|---|
committer | Jonah BrĂ¼chert <jbb@kaidan.im> | 2023-05-22 00:28:12 +0200 |
commit | 955e66c149a8df3a1af78d8766eb46b78af76a82 (patch) | |
tree | 1598aadb0ec21c91b4d54f70a4016336bae33fe7 /accounts/models.py | |
parent | c70cd40a012760e584677940d90d4d6613176238 (diff) | |
download | web-955e66c149a8df3a1af78d8766eb46b78af76a82.tar.gz web-955e66c149a8df3a1af78d8766eb46b78af76a82.tar.bz2 web-955e66c149a8df3a1af78d8766eb46b78af76a82.zip |
2to3: UTF-8 is now default in Python 3
Diffstat (limited to 'accounts/models.py')
-rw-r--r-- | accounts/models.py | 15 |
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): |