aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask
diff options
context:
space:
mode:
authorBonfaceKilz2020-08-26 17:38:13 +0300
committerBonfaceKilz2020-08-26 17:38:13 +0300
commit94f97127a9e451c7adb36613d090a612601b9d01 (patch)
tree1881f63313ef5cdb28c0fa2c3aba2ba07b62e5e4 /wqflask/wqflask
parent133db0e8dbc5a0812dc1f06402f2b788aecaef20 (diff)
downloadgenenetwork2-94f97127a9e451c7adb36613d090a612601b9d01.tar.gz
Rename "unicode" to "str"
See: <https://docs.python.org/2/library/2to3.html#2to3fixer-unicode>
Diffstat (limited to 'wqflask/wqflask')
-rw-r--r--wqflask/wqflask/model.py6
-rw-r--r--wqflask/wqflask/user_manager.py2
-rw-r--r--wqflask/wqflask/user_session.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/wqflask/wqflask/model.py b/wqflask/wqflask/model.py
index 38117a8e..a135761c 100644
--- a/wqflask/wqflask/model.py
+++ b/wqflask/wqflask/model.py
@@ -18,7 +18,7 @@ from wqflask.database import Base, init_db
class User(Base):
__tablename__ = "user"
- id = Column(Unicode(36), primary_key=True, default=lambda: unicode(uuid.uuid4()))
+ id = Column(Unicode(36), primary_key=True, default=lambda: str(uuid.uuid4()))
email_address = Column(Unicode(50), unique=True, nullable=False)
# Todo: Turn on strict mode for Mysql
@@ -120,7 +120,7 @@ class User(Base):
class Login(Base):
__tablename__ = "login"
- id = Column(Unicode(36), primary_key=True, default=lambda: unicode(uuid.uuid4()))
+ id = Column(Unicode(36), primary_key=True, default=lambda: str(uuid.uuid4()))
user = Column(Unicode(36), ForeignKey('user.id'))
timestamp = Column(DateTime(), default=lambda: datetime.datetime.utcnow())
ip_address = Column(Unicode(39))
@@ -138,7 +138,7 @@ class Login(Base):
class UserCollection(Base):
__tablename__ = "user_collection"
- id = Column(Unicode(36), primary_key=True, default=lambda: unicode(uuid.uuid4()))
+ id = Column(Unicode(36), primary_key=True, default=lambda: str(uuid.uuid4()))
user = Column(Unicode(36), ForeignKey('user.id'))
# I'd prefer this to not have a length, but for the index below it needs one
diff --git a/wqflask/wqflask/user_manager.py b/wqflask/wqflask/user_manager.py
index 56d1c084..3c41e2b8 100644
--- a/wqflask/wqflask/user_manager.py
+++ b/wqflask/wqflask/user_manager.py
@@ -252,7 +252,7 @@ class UserSession(object):
def add_collection(self, collection_name, traits):
"""Add collection into ElasticSearch"""
- collection_dict = {'id': unicode(uuid.uuid4()),
+ collection_dict = {'id': str(uuid.uuid4()),
'name': collection_name,
'created_timestamp': datetime.datetime.utcnow().strftime('%b %d %Y %I:%M%p'),
'changed_timestamp': datetime.datetime.utcnow().strftime('%b %d %Y %I:%M%p'),
diff --git a/wqflask/wqflask/user_session.py b/wqflask/wqflask/user_session.py
index 3aa2c151..71c31c57 100644
--- a/wqflask/wqflask/user_session.py
+++ b/wqflask/wqflask/user_session.py
@@ -184,7 +184,7 @@ class UserSession(object):
def add_collection(self, collection_name, traits):
"""Add collection into Redis"""
- collection_dict = {'id': unicode(uuid.uuid4()),
+ collection_dict = {'id': str(uuid.uuid4()),
'name': collection_name,
'created_timestamp': datetime.datetime.utcnow().strftime('%b %d %Y %I:%M%p'),
'changed_timestamp': datetime.datetime.utcnow().strftime('%b %d %Y %I:%M%p'),