-
-
Notifications
You must be signed in to change notification settings - Fork 167
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Issue with Bulk Update Submission - Parse XML with namespace #4283
Comments
Hi @yvalentin, thanks so much for the detailed bug report! We would be happy to accept a pull request, but I think it should have the following鈥攚hich may be too much to ask of a casual contribution 馃槆 Let me know what you think.
Reproducing the problem
Simplest workaround
Alternative with single XPath
Preferred, with security improvement and single XPath
(note that @JacquelineMorrissette, fyi, since this mentions defusedxml, which is related to the static analysis security work you've been doing. |
Note that switching to |
Work is beginning on the switch to defusedxml |
Ok ! Thanks for your feedback. We have plan to work on this and come back by the end of the next week |
(note for internal xref: https://chat.kobotoolbox.org/#narrow/stream/17-Developer-Community/topic/Bulk-edit) |
Description
On the
bulk_update_submissions
function fromkpi/deployment_backends/kobocat_backend.py
if the xml from kobocat have a namespace this part of code failed with an 500 error.The following part of code throw the error:
etree
can not find anything if the xml have a namespace.On our test/dev env, we use a tool (https://docs.getodk.org/briefcase-intro/) to import/initialize some data. So this tool, add a namespace (
xmlns="http://opendatakit.org/submissions"
) on our data:Expected behavior
The Bulk Update Submission should worked with or without namespace on submission xml
Actual behavior
Curl Request:
With a submission who have a namespace, we got an 500 status code error.
On mode dev/debugger activate, the error detail is:
TypeError: Argument '_parent' has incorrect type (expected lxml.etree._Element, got NoneType)
Stack trace (interesting part):
Additional details
I can provide a merge request with an updated version of this part of code to remove the namespace before to search something on the
xml_parsed
The text was updated successfully, but these errors were encountered: