Skip to content

Commit 1a7d492

Browse files
authored
Merge pull request #93 from kurusugawa-computer/fix/update_status_of_inspections
Fix/update status of inspections
2 parents 58a5e14 + ef46669 commit 1a7d492

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

annofabapi/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.21.3'
1+
__version__ = '0.21.4'

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)