aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorBonfaceKilz2020-09-29 22:59:38 +0300
committerBonfaceKilz2020-09-29 23:06:03 +0300
commit744d0cd6cd5e2bca98acbec1b8a1eed6986f824e (patch)
tree1338d02792a8e8f47bf8a0863e14759996c37fc9 /wqflask
parentd6fa2ebf9b3c53daec63e2ccd23feb87335a1e81 (diff)
downloadgenenetwork2-744d0cd6cd5e2bca98acbec1b8a1eed6986f824e.tar.gz
Apply pep 8 to buffer
* wqflask/wqflask/user_manager.py: Remove some stale comments. (imports): Apply pep-8 and remove unused imports.
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/user_manager.py73
1 files changed, 33 insertions, 40 deletions
diff --git a/wqflask/wqflask/user_manager.py b/wqflask/wqflask/user_manager.py
index 24191a15..7b25b68e 100644
--- a/wqflask/wqflask/user_manager.py
+++ b/wqflask/wqflask/user_manager.py
@@ -2,50 +2,62 @@ import os
import hashlib
import datetime
import time
-import logging
import uuid
-import hashlib
import hmac
import base64
-import urllib.parse
-
+import redis # used for collections
import simplejson as json
+import requests
-#from redis import StrictRedis
-import redis # used for collections
-Redis = redis.StrictRedis()
+from base.data_set import create_datasets_list
-from flask import (Flask, g, render_template, url_for, request, make_response,
- redirect, flash, abort)
+from flask import g
+from flask import render_template
+from flask import url_for
+from flask import request
+from flask import make_response
+from flask import redirect
+from flask import flash
from wqflask import app
-from pprint import pformat as pf
-
-from wqflask import pbkdf2 # password hashing
+from wqflask import pbkdf2 # password hashing
from wqflask.database import db_session
from wqflask import model
-from utility import Bunch, Struct, after
+from smtplib import SMTP
+
+from pprint import pformat as pf
-import logging
+from utility import Bunch
+from utility import Struct
from utility.logger import getLogger
-logger = getLogger(__name__)
-from base.data_set import create_datasets_list
+from utility.redis_tools import get_user_id
+from utility.redis_tools import get_user_by_unique_column
+from utility.redis_tools import set_user_attribute
+from utility.redis_tools import save_user
+from utility.redis_tools import save_verification_code
+from utility.redis_tools import check_verification_code
+from utility.redis_tools import get_user_collections
+from utility.redis_tools import save_collections
-import requests
+from utility.tools import SMTP_CONNECT
+from utility.tools import SMTP_USERNAME
+from utility.tools import SMTP_PASSWORD
-from utility.redis_tools import get_user_id, get_user_by_unique_column, set_user_attribute, save_user, save_verification_code, check_verification_code, get_user_collections, save_collections
-from smtplib import SMTP
-from utility.tools import SMTP_CONNECT, SMTP_USERNAME, SMTP_PASSWORD, LOG_SQL_ALCHEMY
+logger = getLogger(__name__)
+
+
+Redis = redis.StrictRedis()
THREE_DAYS = 60 * 60 * 24 * 3
-#THREE_DAYS = 45
+
def timestamp():
return datetime.datetime.utcnow().isoformat()
+
class AnonUser(object):
"""Anonymous user handling"""
cookie_name = 'anon_user_v1'
@@ -228,25 +240,6 @@ class UserSession(object):
return len(self.user_collections)
-###
-# ZS: This is currently not used, but I'm leaving it here commented out because the old "set superuser" code (at the bottom of this file) used it
-###
-# @property
-# def user_ob(self):
-# """Actual sqlalchemy record"""
-# # Only look it up once if needed, then store it
-# # raise "OBSOLETE: use ElasticSearch instead"
-# try:
-# if LOG_SQL_ALCHEMY:
-# logging.getLogger('sqlalchemy.pool').setLevel(logging.DEBUG)
-#
-# # Already did this before
-# return self.db_object
-# except AttributeError:
-# # Doesn't exist so we'll create it
-# self.db_object = model.User.query.get(self.user_id)
-# return self.db_object
-
def add_collection(self, collection_name, traits):
"""Add collection into ElasticSearch"""