mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-30 18:13:23 +08:00
Small improvements to collection creation API.
Return full collection when creating collection and improved error handling during creation.
This commit is contained in:
@@ -202,6 +202,10 @@ class DatasetCollectionsService(
|
||||
def __load_elements( self, trans, element_identifiers ):
|
||||
elements = odict.odict()
|
||||
for element_identifier in element_identifiers:
|
||||
if "name" not in element_identifier:
|
||||
raise RequestParameterInvalidException(
|
||||
"Cannot load invalid dataset identifier - missing name - %s" % element_identifier
|
||||
)
|
||||
elements[ element_identifier[ "name" ] ] = self.__load_element( trans, element_identifier )
|
||||
return elements
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ class HistoryContentsController( BaseAPIController, UsesHistoryDatasetAssociatio
|
||||
create_params = api_payload_to_create_params( payload )
|
||||
service = trans.app.dataset_collections_service
|
||||
dataset_collection_instance = service.create( trans, parent=history, **create_params )
|
||||
return self.__collection_dict( trans, dataset_collection_instance )
|
||||
return self.__collection_dict( trans, dataset_collection_instance, view="element" )
|
||||
|
||||
@expose_api_anonymous
|
||||
def update( self, trans, history_id, id, payload, **kwd ):
|
||||
|
||||
Reference in New Issue
Block a user