alchemy flush and save functions updated
This commit is contained in:
@@ -50,7 +50,6 @@ def save_access_token_to_redis(
|
||||
Employees,
|
||||
Staff,
|
||||
)
|
||||
print('save_access_token_to_redis')
|
||||
if not found_user:
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
@@ -58,10 +57,8 @@ def save_access_token_to_redis(
|
||||
# headers=json.loads(json.dumps(request.headers)),
|
||||
)
|
||||
|
||||
print('save_access_token_to_redis', found_user)
|
||||
# Check user is already logged in or has a previous session
|
||||
already_tokens = get_object_via_user_uu_id(user_id=found_user.uu_id)
|
||||
print('already_tokens', already_tokens)
|
||||
for key in already_tokens or []:
|
||||
token_user = json.loads(redis_cli.get(key).decode() or {})
|
||||
if token_user.get("domain", "") == domain:
|
||||
@@ -70,7 +67,6 @@ def save_access_token_to_redis(
|
||||
access_token = (
|
||||
found_user.generate_access_token() if not access_token else access_token
|
||||
)
|
||||
print('access_token', access_token)
|
||||
# Prepare the user's details to save in Redis Session
|
||||
if found_user.is_occupant: # Check if user is NOT an occupant
|
||||
living_spaces: list[BuildLivingSpace] = BuildLivingSpace.filter_all(
|
||||
@@ -84,7 +80,6 @@ def save_access_token_to_redis(
|
||||
),
|
||||
# headers=json.loads(json.dumps(request.headers)),
|
||||
)
|
||||
print('living_spaces', living_spaces)
|
||||
occupants_selection_dict = {}
|
||||
for living_space in living_spaces:
|
||||
build_parts_selection = BuildParts.filter_active(
|
||||
|
||||
Reference in New Issue
Block a user