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

Disallow entity creation via API for unpublished datasets #986

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

ktuite
Copy link
Member

@ktuite ktuite commented Sep 14, 2023

Closes getodk/central#483

Follows suggestions from that PR:

  1. Noticed that Datasets.get() was getting all datasets including unpublished ones so entities could in some cases be created via API before dataset was published and available (only if they had no data properties, though).
  2. Checked usage of Datasets.get() throughout code
  3. Made 3rd param publishedOnly non-optional and set to false in the only place it matters: when uploading multiple forms that contribute to a dataset and none are published yet.
    • I looked into this case a little more and saw how with this flag set incorrectly (set to only find published datasets), we'd get an extra actee id in the database but it didn't show up in any tests.

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

Test and inspecting and agreeing with the comments in the original issue.

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

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?

Can't make entities before their entity lists.

Does this change require updates to the API documentation? If so, please update docs/api.md as part of this PR.

no

Before submitting this PR, please make sure you have:

  • run make test-full and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code from external sources are properly credited in comments or that everything is internally sourced

@ktuite ktuite merged commit a46f05c into master Sep 15, 2023
4 checks passed
@ktuite ktuite deleted the ktuite/dataset-getter branch September 15, 2023 16:54
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.

Disallow entity creation via API for unpublished entity list
2 participants