kpi is the (frontend) server for KoboToolbox. It includes an API for users to access data and manage their forms, question library, sharing settings, create reports, and export data.
[ ] If you've added code that should be tested, add tests
[ ] If you've changed APIs, update (or create!) the documentation
[x] Ensure the tests pass
[x] Make sure that your code lints and that you've followed our coding style
[x] Write a title and, if necessary, a description of your work suitable for publishing in our release notes
[ ] Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
[ ] Open an issue in the docs if there are UI/UX changes
Description
Fixes a 500 error when trying to access submission data in projects where one or more submissions has non-standard XML.
Notes
These are accepted by KoboCAT but were breaking the submission API because the logic to rewrite attachment URLs required formhub/uuid to be present in the JSON submission representation.
This change tries first to read the form UUID from the KoboCAT API response stored at the asset level (deployment.backend_response) and, if that's somehow missing, only then does it attempt to read the UUID from the submission.
Checklist
Description
Fixes a 500 error when trying to access submission data in projects where one or more submissions has non-standard XML.
Notes
These are accepted by KoboCAT but were breaking the submission API because the logic to rewrite attachment URLs required
formhub/uuid
to be present in the JSON submission representation.This change tries first to read the form UUID from the KoboCAT API response stored at the asset level (
deployment.backend_response
) and, if that's somehow missing, only then does it attempt to read the UUID from the submission.