Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it: With two or more files in a draft dataset, the Delete Dataset option in the dataset page menu fails. (The user is directed to the collection page, but the draft dataset still exists.
Which issue(s) this PR closes:
Closes #
Special notes for your reviewer: There is a long discussion in the core team's slack. What changed to start causing this/why explicitly deleting the filemetadata list from the version is now a fix is not completely clear. (~makes sense why you'd need to get rid of the fm references in the version, but why wasn't that needed before?)
Suggestions on how to test this: Add a dataset with two or more files. Verify that delete works as expected. Could/should also test the api/datasets/id/destroy call (same command) and that harvesting still works (harvesting calls destroy dataset if a dataset with that DOI already exists).
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: