fix bug
Showing
2 changed files
with
6 additions
and
4 deletions
... | @@ -150,7 +150,7 @@ class ECM: | ... | @@ -150,7 +150,7 @@ class ECM: |
150 | args['file_base64_content'] = file_data | 150 | args['file_base64_content'] = file_data |
151 | response = requests.post(self.upload_url, headers=self.get_headers(), json=args, verify=False) | 151 | response = requests.post(self.upload_url, headers=self.get_headers(), json=args, verify=False) |
152 | if response.status_code != 200: | 152 | if response.status_code != 200: |
153 | raise ECMException('ECM upload failed with code: {0} , with headers: {1}'.format( | 153 | raise ECMException('ECM upload failed with code: {0} , with headers: {1} , with content: {2}'.format( |
154 | response.status_code, response.headers)) | 154 | response.status_code, response.headers, response.text)) |
155 | if 'ns6:createResponse' not in response.json().get('S:Envelope', {}).get('S:Body', {}): | 155 | if 'ns6:createResponse' not in response.json().get('S:Envelope', {}).get('S:Body', {}): |
156 | raise ECMException('ECM upload failed: {0} , with headers: {1}'.format(response.json(), response.headers)) | 156 | raise ECMException('ECM upload failed: {0} , with headers: {1}'.format(response.json(), response.headers)) | ... | ... |
... | @@ -846,7 +846,8 @@ class DocView(GenericView, DocHandler): | ... | @@ -846,7 +846,8 @@ class DocView(GenericView, DocHandler): |
846 | if not pdf_file.name.endswith('pdf') and not pdf_file.name.endswith('PDF'): | 846 | if not pdf_file.name.endswith('pdf') and not pdf_file.name.endswith('PDF'): |
847 | self.invalid_params(msg='invalid params: not a PDF file') | 847 | self.invalid_params(msg='invalid params: not a PDF file') |
848 | 848 | ||
849 | business_type = random.choice(consts.BUSINESS_TYPE_LIST) | 849 | # business_type = random.choice(consts.BUSINESS_TYPE_LIST) |
850 | business_type = consts.BUSINESS_TYPE_LIST[0] | ||
850 | tmp_save_path = os.path.join(conf.DATA_DIR, business_type, '{0}.pdf'.format(metadata_version_id)) | 851 | tmp_save_path = os.path.join(conf.DATA_DIR, business_type, '{0}.pdf'.format(metadata_version_id)) |
851 | file_write(pdf_file, tmp_save_path) | 852 | file_write(pdf_file, tmp_save_path) |
852 | 853 | ||
... | @@ -865,7 +866,8 @@ class DocView(GenericView, DocHandler): | ... | @@ -865,7 +866,8 @@ class DocView(GenericView, DocHandler): |
865 | # 1. 上传信息记录 | 866 | # 1. 上传信息记录 |
866 | application_id = '{0}{1}'.format(consts.FIXED_APPLICATION_ID_PREFIX, metadata_version_id) | 867 | application_id = '{0}{1}'.format(consts.FIXED_APPLICATION_ID_PREFIX, metadata_version_id) |
867 | upload_finish_time = timezone.now() | 868 | upload_finish_time = timezone.now() |
868 | document_scheme = random.choice(consts.DOC_SCHEME_LIST) | 869 | # document_scheme = random.choice(consts.DOC_SCHEME_LIST) |
870 | document_scheme = consts.DOC_SCHEME_LIST[1] | ||
869 | data_source = random.choice(consts.DATA_SOURCE_LIST) | 871 | data_source = random.choice(consts.DATA_SOURCE_LIST) |
870 | # UploadDocRecords.objects.create( | 872 | # UploadDocRecords.objects.create( |
871 | # metadata_version_id=metadata_version_id, | 873 | # metadata_version_id=metadata_version_id, | ... | ... |
-
Please register or sign in to post a comment