Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 6 additions & 4 deletions entity-api-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,8 @@ components:
- Invalid
- Submitted
- Incomplete
description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete'
- Approval
description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete|Approval'
title:
type: string
description: 'The dataset title.'
Expand Down Expand Up @@ -883,7 +884,7 @@ components:
- Reorganized
- Processing
- Submitted
- Imcomplete
- Incomplete
description: 'One of: New|Valid|Invalid|Error|Reorganized|Processing|Submitted|Incomplete'
validation_message:
type: string
Expand Down Expand Up @@ -1098,8 +1099,9 @@ components:
- Hold
- Invalid
- Submitted
- Imcomplete
description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete'
- Incomplete
- Approval
description: 'One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete|Approval'
title:
type: string
description: 'The Publication title.'
Expand Down
10 changes: 6 additions & 4 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2105,8 +2105,9 @@ def get_siblings(id):
include_revisions = request.args.get('include-old-revisions')
if status is not None:
status = status.lower()
if status not in ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted']:
bad_request_error("Invalid Dataset Status. Must be 'new', 'qa', or 'published' Case-Insensitive")
allowed_statuses = ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'approval']
if status not in allowed_statuses:
bad_request_error(f"Invalid Dataset Status. Must be one of: {', '.join(allowed_statuses)}")
if property_key is not None:
property_key = property_key.lower()
result_filtering_accepted_property_keys = ['uuid']
Expand Down Expand Up @@ -2239,8 +2240,9 @@ def get_tuplets(id):
status = request.args.get('status')
if status is not None:
status = status.lower()
if status not in ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted']:
bad_request_error("Invalid Dataset Status. Must be 'new', 'qa', or 'published' Case-Insensitive")
allowed_statuses = ['new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'approval']
if status not in allowed_statuses:
bad_request_error(f"Invalid Dataset Status. Must be one of: {', '.join(allowed_statuses)}")
if property_key is not None:
property_key = property_key.lower()
result_filtering_accepted_property_keys = ['uuid']
Expand Down
2 changes: 1 addition & 1 deletion src/schema/provenance_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ ENTITIES:
- validate_dataset_not_component
generated: true
indexed: true
description: "One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete"
description: "One of: New|Processing|Published|QA|Error|Hold|Invalid|Submitted|Incomplete|Approval"
before_create_trigger: set_dataset_status_new
after_create_trigger: set_status_history
after_update_trigger: update_status
Expand Down
4 changes: 2 additions & 2 deletions src/schema/schema_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,12 +1441,12 @@ def normalize_entity_type(entity_type):
Parameters
----------
status : str
One of the status types: New|Processing|QA|Published|Error|Hold|Invalid
One of the status types: New|Processing|QA|Published|Error|Hold|Invalid|Approval

Returns
-------
string
One of the normalized status types: New|Processing|QA|Published|Error|Hold|Invalid
One of the normalized status types: New|Processing|QA|Published|Error|Hold|Invalid|Approval
"""
def normalize_status(status):
if status.lower() == "qa":
Expand Down
2 changes: 1 addition & 1 deletion src/schema/schema_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def validate_application_header_before_property_update(property_key, normalized_
def validate_dataset_status_value(property_key, normalized_entity_type, request, existing_data_dict, new_data_dict):
# Use lowercase for comparison
accepted_status_values = [
'new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'incomplete'
'new', 'processing', 'published', 'qa', 'error', 'hold', 'invalid', 'submitted', 'incomplete', 'approval'
]
new_status = new_data_dict[property_key].lower()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ x-ref-components:
- Error
- Hold
- Invalid
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid"
- Approval
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid|Approval"
title:
type: string
description: "The dataset title."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ Dataset:
- Error
- Hold
- Invalid
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid"
- Approval
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid|Approval"
title:
type: string
description: "The dataset title."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@ components:
- Error
- Hold
- Invalid
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid"
- Approval
description: "One of: New|Processing|QA|Published|Error|Hold|Invalid|Approval"
title:
type: string
description: "The dataset title."
Expand Down
Loading