Skip to content

Commit dbb949e

Browse files
authored
uuid of new project composed by template, user and parametrization (#933)
Fixes study links for parameterized template studies
1 parent fa0749e commit dbb949e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

services/web/server/src/simcore_service_webserver/studies_access.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
BASE_UUID = uuid.UUID("71e0eb5e-0797-4469-89ba-00a0df4d338a")
2828

2929
@lru_cache()
30-
def compose_uuid(template_uuid, user_id) -> str:
30+
def compose_uuid(template_uuid, user_id, query="") -> str:
3131
""" Creates a new uuid composing a project's and user ids such that
3232
any template pre-assigned to a user
3333
3434
Enforces a constraint: a user CANNOT have multiple copies of the same template
3535
"""
36-
new_uuid = str( uuid.uuid5(BASE_UUID, str(template_uuid) + str(user_id)) )
36+
new_uuid = str( uuid.uuid5(BASE_UUID, str(template_uuid) + str(user_id) + str(query)) )
3737
return new_uuid
3838

3939

@@ -108,7 +108,7 @@ async def copy_study_to_account(request: web.Request, template_project: Dict, us
108108
template_parameters = dict(request.query)
109109

110110
# assign id to copy
111-
project_uuid = compose_uuid(template_project["uuid"], user["id"])
111+
project_uuid = compose_uuid(template_project["uuid"], user["id"], str(template_parameters))
112112

113113
try:
114114
# Avoids multiple copies of the same template on each account

0 commit comments

Comments
 (0)