You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In entities/<entity_type> (create_entity), for the field previous_version_uuid, the code allows for this uuid to be for either datasets or samples.
# Make sure the previous version entity is either a Dataset or Sample
if previous_version_dict['entity_type'] not in ['Dataset', 'Sample']:
bad_request_error(f"The previous_revision_uuid specified for this dataset must either be a Dataset or Sample"
However, if the uuid for a sample is given, a 500 will be raised when the following section of the code is reached:
# Only published datasets can have revisions made of them. Verify that the status of the Dataset specified
# by previous_revision_uuid is published. Else, bad request error.
if previous_version_dict['status'].lower() != DATASET_STATUS_PUBLISHED:
bad_request_error(f"The previous_revision_uuid specified for this dataset must be 'Published' in order to create a new revision from it")
Since samples do not contain status field, the error occurs. Either move this status check under a conditional if previous_version_dict['entity_type'] == "Dataset" or modify the earlier conditional to only include datasets and not datasets or samples. Previous revision should never be a sample so this seems to be the better option.
Unless something entirely different was intended, in which case this whole section may need modified.
The text was updated successfully, but these errors were encountered:
In entities/<entity_type> (create_entity), for the field previous_version_uuid, the code allows for this uuid to be for either datasets or samples.
However, if the uuid for a sample is given, a 500 will be raised when the following section of the code is reached:
Since samples do not contain status field, the error occurs. Either move this status check under a conditional
if previous_version_dict['entity_type'] == "Dataset"
or modify the earlier conditional to only include datasets and not datasets or samples. Previous revision should never be a sample so this seems to be the better option.Unless something entirely different was intended, in which case this whole section may need modified.
The text was updated successfully, but these errors were encountered: