-
Notifications
You must be signed in to change notification settings - Fork 1
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
Report non-processing state check #309
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
src/sbl_filing_api/routers/filing.py
Outdated
@@ -342,7 +342,7 @@ async def get_latest_submission_report(request: Request, lei: str, period_code: | |||
"Cache-Control": "no-store", | |||
}, | |||
) | |||
return JSONResponse(status_code=status.HTTP_204_NO_CONTENT, content=None) | |||
return JSONResponse(status_code=status.HTTP_404_NOT_FOUND, content=None) |
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.
let's standardize the non-200 code handling and use RegTechHttpException
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.
same with the other report endpoint
src/sbl_filing_api/routers/filing.py
Outdated
@@ -352,7 +352,7 @@ async def get_latest_submission_report(request: Request, lei: str, period_code: | |||
@requires("authenticated") | |||
async def get_submission_report(request: Request, response: Response, lei: str, period_code: str, id: int): | |||
sub = await repo.get_submission(request.state.db_session, id) | |||
if sub: | |||
if sub and not sub.state == SubmissionState.VALIDATION_IN_PROGRESS: |
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 won't work. Submissions could go to VALIDATION_ERROR without writing a report, or SUBMISSION_FAILED, SUBMISSION_UPLOAD, etc. So check for completed states
Closes #286