[MDS-7018] Include manually uploaded files in spatial validation + fix error in certain cases - #3995
Conversation
…x error in certain cases
fb4e8a2 to
8ab237d
Compare
| except Exception as e: | ||
| message = f'Failed to add an Import Notice of Work Submission Documents job to the task queue: {str(e)}' | ||
|
|
||
| raise |
There was a problem hiding this comment.
The error message built on 164 won't be returned to the caller since we raise on 165, and the caller (import_now_submission_documents_job.py) has no try/except, so this becomes an unhandled 500 instead of a proper error response. Could we have the caller handle this explicitly via try/except that returns the correct status code w/the error message?
There was a problem hiding this comment.
Wops, intention was to log the message 😓
Think the 500 is still appropriate in this case, but added a nicer message to it
There was a problem hiding this comment.
I figured we probably wanted the message, and I do think a 500 is the correct code - thanks for propagating the message up!
|



Objective
MDS-7018
Included manually uploaded application files in NoW spatial validation. Docman doesn't know which files these are, so they're passed in from the core-api.
Fixed an error that pops up in the docman worker if you're trying to update a record using the AuditMixin (e.g. happens if you re-validate a spatial file with a different user than the first attempt). It would try to get the update_user from the user request token, which is not present as it's an async task. In this case, fall back to the
mdsuser, which is in use as the "system user" for docmanLittle cleanup: Removed the last use of the flower celery API in docman, instead use
task.delay/celery.control.revoketo be consistent.