Removed double declared functions

This commit is contained in:
Ozzieisaacs 2021-11-21 09:13:26 +01:00
parent 5ede079401
commit 9273843062

View File

@ -62,27 +62,13 @@ searched_ids = {}
logged_in = dict() logged_in = dict()
def store_user_session():
if flask_session.get('_user_id', ""):
if logged_in.get(flask_session.get('_user_id', "")):
logged_in[flask_session.get('_user_id', "")].append(flask_session.get('_id', ""))
else:
logged_in[flask_session.get('_user_id', "")] = [flask_session.get('_id', "")]
log.info(flask_session.get('_id', ""))
def delete_user_session(user_id, session_key):
try:
logged_in.get(str(user_id), []).remove(session_key)
except ValueError:
pass
def check_user_session(user_id, session_key):
return session_key in logged_in.get(str(user_id), [])
def signal_store_user_session(object, user): def signal_store_user_session(object, user):
store_user_session() store_user_session()
def store_user_session(): def store_user_session():
if flask_session.get('user_id', ""):
flask_session['_user_id'] = flask_session.get('user_id', "")
if flask_session.get('_user_id', ""): if flask_session.get('_user_id', ""):
try: try:
if not check_user_session(flask_session.get('_user_id', ""), flask_session.get('_id', "")): if not check_user_session(flask_session.get('_user_id', ""), flask_session.get('_id', "")):