13
13
from annofabapi import AnnofabApi
14
14
from annofabapi .exceptions import AnnofabApiException
15
15
from annofabapi .models import (AnnotationSpecs , InputData , Inspection , Instruction , JobInfo , JobType , MyOrganization ,
16
- OrganizationMember , Project , ProjectMember , SupplementaryData , Task )
16
+ OrganizationMember , Project , ProjectMember , SupplementaryData , Task , InspectionStatus )
17
17
18
18
logger = logging .getLogger (__name__ )
19
19
@@ -348,7 +348,7 @@ def put_supplementary_data_from_file(self, project_id, input_data_id: str, suppl
348
348
#########################################
349
349
def update_status_of_inspections (self , project_id : str , task_id : str , input_data_id : str ,
350
350
filter_inspection : Callable [[Inspection ], bool ],
351
- inspection_status : str ) -> List [Inspection ]:
351
+ inspection_status : InspectionStatus ) -> List [Inspection ]:
352
352
"""
353
353
検査コメント(返信コメント以外)のstatusを変更する。
354
354
@@ -375,9 +375,11 @@ def search_updated_inspections(arg_inspection: Inspection) -> bool:
375
375
target_inspections = [e for e in inspections if search_updated_inspections (e )]
376
376
377
377
for inspection in target_inspections :
378
- inspection ["status" ] = inspection_status
378
+ inspection ["status" ] = inspection_status . value
379
379
if inspection ["updated_datetime" ] is None :
380
380
inspection ["updated_datetime" ] = inspection ["created_datetime" ]
381
+ else :
382
+ inspection ["updated_datetime" ] = annofabapi .utils .str_now ()
381
383
382
384
req_inspection = [{"data" : e , "_type" : "Put" } for e in target_inspections ]
383
385
content = self .api .batch_update_inspections (project_id , task_id , input_data_id , req_inspection )[0 ]
0 commit comments