Skip to content

Commit 33df8d1

Browse files
committed
fixed
1 parent d7c1354 commit 33df8d1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

services/web/server/src/simcore_service_webserver/projects/_projects_service.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,17 @@ async def try_open_project_for_user(
15651565
)
15661566
async def _open_project() -> bool:
15671567
with managed_resource(user_id, client_session_id, app) as user_session:
1568+
# check if the project is already opened
1569+
if (
1570+
current_project_ids := await user_session.find(PROJECT_ID_KEY)
1571+
) and current_project_ids == [f"{project_uuid}"]:
1572+
_logger.debug(
1573+
"project %s is already opened by user %s/%s",
1574+
project_uuid,
1575+
user_id,
1576+
client_session_id,
1577+
)
1578+
return True
15681579
# Enforce per-user open project limit
15691580
if max_number_of_opened_projects_per_user is not None and (
15701581
len(
@@ -1585,7 +1596,7 @@ async def _open_project() -> bool:
15851596
client_session_id=client_session_id,
15861597
)
15871598

1588-
# Assign project_id to current_session
1599+
# try to assign project_id to current_session
15891600
sessions_with_project = await user_session.find_users_of_resource(
15901601
app, PROJECT_ID_KEY, f"{project_uuid}"
15911602
)

0 commit comments

Comments
 (0)