diff --git a/src/kili/adapters/kili_api_gateway/project/mappers.py b/src/kili/adapters/kili_api_gateway/project/mappers.py index 371c20529..142f6273d 100644 --- a/src/kili/adapters/kili_api_gateway/project/mappers.py +++ b/src/kili/adapters/kili_api_gateway/project/mappers.py @@ -51,4 +51,5 @@ def project_data_mapper(data: ProjectDataKiliAPIGatewayInput) -> Dict: "shouldRelaunchKpiComputation": data.should_relaunch_kpi_computation, "title": data.title, "useHoneyPot": data.use_honeypot, + "secondsToLabelBeforeAutoAssign": data.seconds_to_label_before_auto_assign, } diff --git a/src/kili/adapters/kili_api_gateway/project/types.py b/src/kili/adapters/kili_api_gateway/project/types.py index 578f8a300..4706646a1 100644 --- a/src/kili/adapters/kili_api_gateway/project/types.py +++ b/src/kili/adapters/kili_api_gateway/project/types.py @@ -35,3 +35,4 @@ class ProjectDataKiliAPIGatewayInput: should_relaunch_kpi_computation: Optional[bool] title: Optional[str] use_honeypot: Optional[bool] + seconds_to_label_before_auto_assign: Optional[int] diff --git a/src/kili/presentation/client/project.py b/src/kili/presentation/client/project.py index 42809f42f..f5f9b5c6b 100644 --- a/src/kili/presentation/client/project.py +++ b/src/kili/presentation/client/project.py @@ -290,6 +290,7 @@ def update_properties_in_project( should_relaunch_kpi_computation: Optional[bool] = None, title: Optional[str] = None, use_honeypot: Optional[bool] = None, + seconds_to_label_before_auto_assign: Optional[bool] = None, metadata_types: Optional[dict] = None, ) -> Dict[str, Any]: """Update properties of a project. @@ -324,6 +325,8 @@ def update_properties_in_project( in honeypot or consensus settings title: Title of the project use_honeypot: Activate / Deactivate the use of honeypot in the project + seconds_to_label_before_auto_assign: Number of seconds before an asset is automatically + assigned to a labeler on new label. metadata_types: Types of the project metadata. Should be a `dict` of metadata fields name as keys and metadata types as values. Currently, possible types are: `string`, `number` @@ -373,6 +376,7 @@ def update_properties_in_project( review_coverage=review_coverage, should_relaunch_kpi_computation=should_relaunch_kpi_computation, use_honeypot=use_honeypot, + seconds_to_label_before_auto_assign=seconds_to_label_before_auto_assign, title=title, metadata_types=metadata_types, ) diff --git a/src/kili/services/copy_project/__init__.py b/src/kili/services/copy_project/__init__.py index 50e91889f..7b7f5bfad 100644 --- a/src/kili/services/copy_project/__init__.py +++ b/src/kili/services/copy_project/__init__.py @@ -37,6 +37,7 @@ class ProjectCopier: # pylint: disable=too-few-public-methods "minConsensusSize", "useHoneyPot", "reviewCoverage", + "secondsToLabelBeforeAutoAssign", ) def __init__(self, kili: "Kili") -> None: @@ -159,6 +160,7 @@ def _copy_quality_settings(self, new_project_id: str, src_project: Dict) -> None consensus_tot_coverage=src_project["consensusTotCoverage"], min_consensus_size=src_project["minConsensusSize"], use_honeypot=src_project["useHoneyPot"], + seconds_to_label_before_auto_assign=src_project["secondsToLabelBeforeAutoAssign"], review_coverage=src_project["reviewCoverage"], ) diff --git a/src/kili/use_cases/project/project.py b/src/kili/use_cases/project/project.py index e04d86dac..82c5fb6ca 100644 --- a/src/kili/use_cases/project/project.py +++ b/src/kili/use_cases/project/project.py @@ -90,6 +90,7 @@ def update_properties_in_project( should_relaunch_kpi_computation: Optional[bool], title: Optional[str], use_honeypot: Optional[bool], + seconds_to_label_before_auto_assign: Optional[int], metadata_types: Optional[Dict], ) -> Dict[str, object]: """Update properties in a project.""" @@ -125,6 +126,7 @@ def update_properties_in_project( should_relaunch_kpi_computation=should_relaunch_kpi_computation, title=title, use_honeypot=use_honeypot, + seconds_to_label_before_auto_assign=seconds_to_label_before_auto_assign, archived=None, author=None, rules=None, diff --git a/tests/integration/use_cases/test_project.py b/tests/integration/use_cases/test_project.py index 5738da4c3..1bf104a7d 100644 --- a/tests/integration/use_cases/test_project.py +++ b/tests/integration/use_cases/test_project.py @@ -96,6 +96,7 @@ def mocked_update_properties_in_project( review_coverage=None, should_relaunch_kpi_computation=None, use_honeypot=None, + seconds_to_label_before_auto_assign=None, metadata_types=None, )