b6752f9c by 冯轩

MOD:code

1 parent e4c01a4b
......@@ -2095,10 +2095,10 @@ class DocReOcrView(GenericView, DocHandler):
doc = doc_class.objects.filter(id=doc_id).first()
if doc.application_id.startswith(consts.FIXED_APPLICATION_ID_PREFIX):
self.running_log.info('[doc re-ocr fail not support CH-S] [application_entity={0}] [doc_id={1}]'.format(application_entity, doc_id))
return response.error_msg('模拟下单的文件不支持重新识别')
return response.ok_msg('模拟下单的文件不支持重新识别')
if doc.status != DocStatus.PROCESS_FAILED.value:
self.running_log.info('[doc re-ocr fail not support status] [application_entity={0}] [doc_id={1}]'.format(application_entity, doc_id))
return response.error_msg('不支持的文件状态')
return response.ok_msg('不支持的文件状态')
# 3. 选择队列进入
is_priority = PriorityApplication.objects.filter(application_id=doc.application_id, on_off=True).exists()
......
......@@ -34,6 +34,9 @@ class APIResponse(JsonResponse):
def ok(**kwargs):
return APIResponse(MetaStatus.SUCCESS.value, msg=MetaStatus.SUCCESS.verbose_name, **kwargs)
def ok_msg(msg=MetaStatus.SUCCESS.verbose_name, **kwargs):
return APIResponse(MetaStatus.SUCCESS.value, msg=msg, **kwargs)
def error_msg(msg='internal error', **kwargs):
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!