b6752f9c by 冯轩

MOD:code

1 parent e4c01a4b
...@@ -2095,10 +2095,10 @@ class DocReOcrView(GenericView, DocHandler): ...@@ -2095,10 +2095,10 @@ class DocReOcrView(GenericView, DocHandler):
2095 doc = doc_class.objects.filter(id=doc_id).first() 2095 doc = doc_class.objects.filter(id=doc_id).first()
2096 if doc.application_id.startswith(consts.FIXED_APPLICATION_ID_PREFIX): 2096 if doc.application_id.startswith(consts.FIXED_APPLICATION_ID_PREFIX):
2097 self.running_log.info('[doc re-ocr fail not support CH-S] [application_entity={0}] [doc_id={1}]'.format(application_entity, doc_id)) 2097 self.running_log.info('[doc re-ocr fail not support CH-S] [application_entity={0}] [doc_id={1}]'.format(application_entity, doc_id))
2098 return response.error_msg('模拟下单的文件不支持重新识别') 2098 return response.ok_msg('模拟下单的文件不支持重新识别')
2099 if doc.status != DocStatus.PROCESS_FAILED.value: 2099 if doc.status != DocStatus.PROCESS_FAILED.value:
2100 self.running_log.info('[doc re-ocr fail not support status] [application_entity={0}] [doc_id={1}]'.format(application_entity, doc_id)) 2100 self.running_log.info('[doc re-ocr fail not support status] [application_entity={0}] [doc_id={1}]'.format(application_entity, doc_id))
2101 return response.error_msg('不支持的文件状态') 2101 return response.ok_msg('不支持的文件状态')
2102 2102
2103 # 3. 选择队列进入 2103 # 3. 选择队列进入
2104 is_priority = PriorityApplication.objects.filter(application_id=doc.application_id, on_off=True).exists() 2104 is_priority = PriorityApplication.objects.filter(application_id=doc.application_id, on_off=True).exists()
......
...@@ -34,6 +34,9 @@ class APIResponse(JsonResponse): ...@@ -34,6 +34,9 @@ class APIResponse(JsonResponse):
34 def ok(**kwargs): 34 def ok(**kwargs):
35 return APIResponse(MetaStatus.SUCCESS.value, msg=MetaStatus.SUCCESS.verbose_name, **kwargs) 35 return APIResponse(MetaStatus.SUCCESS.value, msg=MetaStatus.SUCCESS.verbose_name, **kwargs)
36 36
37 def ok_msg(msg=MetaStatus.SUCCESS.verbose_name, **kwargs):
38 return APIResponse(MetaStatus.SUCCESS.value, msg=msg, **kwargs)
39
37 40
38 def error_msg(msg='internal error', **kwargs): 41 def error_msg(msg='internal error', **kwargs):
39 return APIResponse(MetaStatus.INTERNAL_ERROR.value, msg=msg, **kwargs) 42 return APIResponse(MetaStatus.INTERNAL_ERROR.value, msg=msg, **kwargs)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!