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

add: form creation with attachments #92

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

lindsay-stevens
Copy link
Contributor

Closes #79

What has been done to verify that this works as intended?

New tests, checked E2E result in Central

Why is this the best possible solution? Were any other approaches considered?

Follows a similar pattern to forms.update but without the version update, and a definition is required. The attachment upload and publish are separate calls because the form creation endpoint in Central accepts only a form definition.

The returned Form object doesn't include info about the attachments, because if an upload fails then an error will be raised (before the form is published), so a user could assume that no error means all attachments were uploaded.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

New convenience feature to avoid needing to create then update just to upload attachments.

Do we need any specific form for testing your changes? If so, please attach one.

No

Does this change require updates to documentation? If so, please file an issue here and include the link below.

The method docstring is updated with the new parameter.

Before submitting this PR, please make sure you have:

  • included test cases for core behavior and edge cases in tests
  • run python -m unittest and verified all tests pass
  • run ruff format pyodk tests and ruff check pyodk tests to lint code
  • verified that any code or assets from external sources are properly credited in comments

@lognaturel lognaturel merged commit e14a612 into getodk:master Jul 16, 2024
4 checks passed
@lindsay-stevens lindsay-stevens deleted the pyodk-79 branch July 17, 2024 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add form creation with attachments
2 participants