Skip to content
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

Cope with breaking changes in pyxform 3.0.0 #331

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/formpack/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,14 @@ def to_xml(self, warnings=None):
if title is None:
raise ValueError('cannot create xml on a survey with no title.')

survey.update(
{
'name': self.lookup('root_node_name', 'data'),
'id_string': self.lookup('id_string'),
'title': self.lookup('title'),
'version': self.lookup('id'),
}
)
# pyxform 3.0.0 has removed the ability to call `survey.update()`
# https://github.com/XLSForm/pyxform/commit/6918b400d3cf6c9151db2104137afe2c52dd68e4
for k, v in {
'name': self.lookup('root_node_name', 'data'),
'id_string': self.lookup('id_string'),
'title': self.lookup('title'),
'version': self.lookup('id'),
}.items():
survey[k] = v

return survey._to_pretty_xml() # .encode('utf-8')
Loading