8ef9d025 by 周伟奇

fix bug

1 parent f83bf474
......@@ -150,7 +150,7 @@ class ECM:
args['file_base64_content'] = file_data
response = requests.post(self.upload_url, headers=self.get_headers(), json=args, verify=False)
if response.status_code != 200:
raise ECMException('ECM upload failed with code: {0} , with headers: {1}'.format(
response.status_code, response.headers))
raise ECMException('ECM upload failed with code: {0} , with headers: {1} , with content: {2}'.format(
response.status_code, response.headers, response.text))
if 'ns6:createResponse' not in response.json().get('S:Envelope', {}).get('S:Body', {}):
raise ECMException('ECM upload failed: {0} , with headers: {1}'.format(response.json(), response.headers))
......
......@@ -846,7 +846,8 @@ class DocView(GenericView, DocHandler):
if not pdf_file.name.endswith('pdf') and not pdf_file.name.endswith('PDF'):
self.invalid_params(msg='invalid params: not a PDF file')
business_type = random.choice(consts.BUSINESS_TYPE_LIST)
# business_type = random.choice(consts.BUSINESS_TYPE_LIST)
business_type = consts.BUSINESS_TYPE_LIST[0]
tmp_save_path = os.path.join(conf.DATA_DIR, business_type, '{0}.pdf'.format(metadata_version_id))
file_write(pdf_file, tmp_save_path)
......@@ -865,7 +866,8 @@ class DocView(GenericView, DocHandler):
# 1. 上传信息记录
application_id = '{0}{1}'.format(consts.FIXED_APPLICATION_ID_PREFIX, metadata_version_id)
upload_finish_time = timezone.now()
document_scheme = random.choice(consts.DOC_SCHEME_LIST)
# document_scheme = random.choice(consts.DOC_SCHEME_LIST)
document_scheme = consts.DOC_SCHEME_LIST[1]
data_source = random.choice(consts.DATA_SOURCE_LIST)
# UploadDocRecords.objects.create(
# metadata_version_id=metadata_version_id,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!