Skip to content

Commit a510932

Browse files
committed
[wrapper.py update_status_of_inspections] updated_datetime を更新するようにする
1 parent 58a5e14 commit a510932

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

annofabapi/wrapper.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from annofabapi import AnnofabApi
1414
from annofabapi.exceptions import AnnofabApiException
1515
from annofabapi.models import (AnnotationSpecs, InputData, Inspection, Instruction, JobInfo, JobType, MyOrganization,
16-
OrganizationMember, Project, ProjectMember, SupplementaryData, Task)
16+
OrganizationMember, Project, ProjectMember, SupplementaryData, Task, InspectionStatus)
1717

1818
logger = logging.getLogger(__name__)
1919

@@ -348,7 +348,7 @@ def put_supplementary_data_from_file(self, project_id, input_data_id: str, suppl
348348
#########################################
349349
def update_status_of_inspections(self, project_id: str, task_id: str, input_data_id: str,
350350
filter_inspection: Callable[[Inspection], bool],
351-
inspection_status: str) -> List[Inspection]:
351+
inspection_status: InspectionStatus) -> List[Inspection]:
352352
"""
353353
検査コメント(返信コメント以外)のstatusを変更する。
354354
@@ -375,9 +375,11 @@ def search_updated_inspections(arg_inspection: Inspection) -> bool:
375375
target_inspections = [e for e in inspections if search_updated_inspections(e)]
376376

377377
for inspection in target_inspections:
378-
inspection["status"] = inspection_status
378+
inspection["status"] = inspection_status.value
379379
if inspection["updated_datetime"] is None:
380380
inspection["updated_datetime"] = inspection["created_datetime"]
381+
else:
382+
inspection["updated_datetime"] = annofabapi.utils.str_now()
381383

382384
req_inspection = [{"data": e, "_type": "Put"} for e in target_inspections]
383385
content = self.api.batch_update_inspections(project_id, task_id, input_data_id, req_inspection)[0]

0 commit comments

Comments
 (0)