move common code into server, update tests and makefile (#2425)

* move common code into server, update tests and makefile

remove backend directory, refactor

update smoke tests
This commit is contained in:
Madison Dunitz
2021-09-20 18:50:06 -07:00
committed by GitHub
parent 97caa5bcaa
commit 3ebbb0ccbf
217 changed files with 277 additions and 292 deletions
+13
View File
@@ -0,0 +1,13 @@
from uuid import uuid4
from flask.sessions import SessionMixin
CXGUID = "cxguid"
def get_user_id(session: SessionMixin) -> str:
""" Gets a session-persistent user id. Creates one in the Flask session if non-extant """
if CXGUID not in session:
session[CXGUID] = uuid4().hex
session.permanent = True
return session[CXGUID]