Skip to content

Commit 6cecc0f

Browse files
committed
only require project_uuid to get project_marked as job
1 parent 562ebff commit 6cecc0f

File tree

4 files changed

+0
-14
lines changed

4 files changed

+0
-14
lines changed

services/web/server/src/simcore_service_webserver/projects/_controller/projects_rpc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ async def get_project_marked_as_job(
128128
product_name: ProductName,
129129
user_id: UserID,
130130
project_uuid: ProjectID,
131-
job_parent_resource_name: str,
132131
) -> ProjectJobRpcGet:
133132

134133
try:
@@ -137,7 +136,6 @@ async def get_project_marked_as_job(
137136
product_name=product_name,
138137
user_id=user_id,
139138
project_uuid=project_uuid,
140-
job_parent_resource_name=job_parent_resource_name,
141139
)
142140
except ProjectInvalidRightsError as err:
143141
raise ProjectForbiddenRpcError.from_domain_error(err) from err

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ async def get_project_marked_as_job(
213213
connection: AsyncConnection | None = None,
214214
*,
215215
project_uuid: ProjectID,
216-
job_parent_resource_name: str,
217216
) -> ProjectJobDBGet | None:
218217
"""
219218
Returns the project associated with the given project_uuid and job_parent_resource_name
@@ -233,7 +232,6 @@ async def get_project_marked_as_job(
233232
)
234233
.where(
235234
projects_to_jobs.c.project_uuid == f"{project_uuid}",
236-
projects_to_jobs.c.job_parent_resource_name == job_parent_resource_name,
237235
projects.c.workspace_id.is_(None),
238236
)
239237
.limit(1)

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ async def get_project_marked_as_job(
9191
product_name: ProductName,
9292
user_id: UserID,
9393
project_uuid: ProjectID,
94-
job_parent_resource_name: Annotated[
95-
str, AfterValidator(_validate_job_parent_resource_name)
96-
],
9794
) -> ProjectJobDBGet:
9895
"""
9996
Retrieves the project associated with the given project_uuid and job_parent_resource_name.
@@ -110,7 +107,6 @@ async def get_project_marked_as_job(
110107
repo = ProjectJobsRepository.create_from_app(app)
111108
project_id = await repo.get_project_marked_as_job(
112109
project_uuid=project_uuid,
113-
job_parent_resource_name=job_parent_resource_name,
114110
)
115111
if not project_id:
116112
raise ProjectNotFoundError(

services/web/server/tests/unit/with_dbs/02/test_projects_rpc.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ async def test_rpc_client_get_project_marked_as_job_found(
341341
product_name=product_name,
342342
user_id=user_id,
343343
project_uuid=project_uuid,
344-
job_parent_resource_name=job_parent_resource_name,
345344
)
346345
assert project_job.uuid == project_uuid
347346
assert project_job.job_parent_resource_name == job_parent_resource_name
@@ -360,7 +359,6 @@ async def test_rpc_client_get_project_marked_as_job_not_found(
360359

361360
project_uuid = ProjectID(user_project["uuid"])
362361
user_id = logged_user["id"]
363-
job_parent_resource_name = "solvers/solver123/version/1.2.3"
364362

365363
# Do NOT mark the project as a job, so it should not be found
366364
with pytest.raises(ProjectNotFoundRpcError):
@@ -369,7 +367,6 @@ async def test_rpc_client_get_project_marked_as_job_not_found(
369367
product_name=product_name,
370368
user_id=user_id,
371369
project_uuid=project_uuid,
372-
job_parent_resource_name=job_parent_resource_name,
373370
)
374371

375372

@@ -403,7 +400,6 @@ async def test_rpc_client_get_project_marked_as_job_forbidden(
403400
product_name=product_name,
404401
user_id=other_user["id"],
405402
project_uuid=project_uuid,
406-
job_parent_resource_name=job_parent_resource_name,
407403
)
408404

409405

@@ -437,7 +433,6 @@ async def test_mark_and_get_project_job_storage_data_deleted(
437433
product_name=product_name,
438434
user_id=user_id,
439435
project_uuid=project_uuid,
440-
job_parent_resource_name=job_parent_resource_name,
441436
)
442437
assert project_job.storage_data_deleted is True
443438

@@ -457,6 +452,5 @@ async def test_mark_and_get_project_job_storage_data_deleted(
457452
product_name=product_name,
458453
user_id=user_id,
459454
project_uuid=project_uuid,
460-
job_parent_resource_name=job_parent_resource_name,
461455
)
462456
assert project_job.storage_data_deleted is False

0 commit comments

Comments
 (0)