Skip to content

[MDS-7018] Include manually uploaded files in spatial validation + fix error in certain cases - #3995

Merged
simensma-fresh merged 6 commits into
developfrom
MDS-7018_Fix-spatial-validation
Sep 14, 2026
Merged

simensma-fresh merged 6 commits into
developfrom
MDS-7018_Fix-spatial-validation

Conversation

@simensma-fresh

Copy link
Copy Markdown
Collaborator

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 mds user, which is in use as the "system user" for docman

  • Little cleanup: Removed the last use of the flower celery API in docman, instead use task.delay / celery.control.revoke to be consistent.

@simensma-fresh
simensma-fresh force-pushed the MDS-7018_Fix-spatial-validation branch from fb4e8a2 to 8ab237d Compare September 14, 2026 15:26
@simensma-fresh simensma-fresh added the 👍 Ready for review Pull request has been double checked by the author and is ready for comments and feedback. label Sep 14, 2026
Comment on lines +163 to +165
except Exception as e:
message = f'Failed to add an Import Notice of Work Submission Documents job to the task queue: {str(e)}'

raise

@alazar-aot alazar-aot Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wops, intention was to log the message 😓

Think the 500 is still appropriate in this case, but added a nicer message to it

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured we probably wanted the message, and I do think a 500 is the correct code - thanks for propagating the message up!

@sonarqubecloud

Copy link
Copy Markdown

@alazar-aot alazar-aot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apprové!

@simensma-fresh
simensma-fresh merged commit c037f99 into develop Sep 14, 2026
13 checks passed
@simensma-fresh
simensma-fresh deleted the MDS-7018_Fix-spatial-validation branch September 14, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👍 Ready for review Pull request has been double checked by the author and is ready for comments and feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants