-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
24632 create upload document #3141
base: feature-drs-integration
Are you sure you want to change the base?
24632 create upload document #3141
Conversation
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
if not file: | ||
current_app.logger.debug('No file found in request.') | ||
return {'data': 'File not provided'} | ||
current_app.logger.debug(f'Upload file to document record service {file.filename}') |
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
if file_key := foreign_jurisdiction.get('affidavitFileKey'): | ||
if err := validate_pdf(file_key, affidavit_file_key_path, False): | ||
msg.extend(err) | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to validate if a file exist or not against this key
@@ -51,7 +51,6 @@ def validate(filing_json: dict) -> Optional[Error]: # pylint: disable=too-many- | |||
return msg # Cannot continue validation without legal_type | |||
|
|||
msg.extend(validate_business_in_colin(filing_json, filing_type)) | |||
msg.extend(validate_continuation_in_authorization(filing_json, filing_type)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to validate if a file exist or not against this key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so I moved other validations to file submission.
I will add a validation to check if file exists.
Are we moving away from the minio file upload in legal-api? then we need to update COOP file upload (rules and memorandum) in various filings and dissolution and court order file upload. |
# Check that all pages in the pdf are letter size and able to be processed. | ||
if any(x.mediaBox.getWidth() != 612 or x.mediaBox.getHeight() != 792 for x in pdf_reader.pages): | ||
msg.append({'error': _('Document must be set to fit onto 8.5” x 11” letter-size paper.'), | ||
'path': file.filename}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be skipped for continuation in files. Ref: https://github.com/bcgov/lear/blob/main/legal-api/src/legal_api/services/filings/validations/common_validations.py#L179
3rd argument is false in below lines
https://github.com/bcgov/lear/blob/main/legal-api/src/legal_api/services/filings/validations/continuation_in.py#L130
https://github.com/bcgov/lear/blob/main/legal-api/src/legal_api/services/filings/validations/continuation_in.py#L160
Yes, we are replacing Minio with Document Record Service, but for now Continuation In only as a Proof of Concept. |
Issue #: /bcgov/entity#24632
Description of changes:
document_record
ServiceBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).