return empty list if you dont find standalones or libraries

This commit is contained in:
alicia pritchett 2022-02-09 13:09:46 -05:00
parent db93f9be4e
commit 595b866f41
1 changed files with 8 additions and 4 deletions

View File

@ -81,13 +81,17 @@ class WorkflowSpecService(FileSystemService):
return category.specs
def get_libraries(self) -> List[WorkflowSpecInfo]:
spec_list = self.libraries.specs
spec_list.sort(key=lambda w: w.display_order)
spec_list = []
if len(self.libraries.items()) > 0:
spec_list += self.libraries.specs
spec_list.sort(key=lambda w: w.display_order)
return spec_list
def get_standalones(self) -> List[WorkflowSpecInfo]:
spec_list = list(self.standalone.specs)
spec_list.sort(key=lambda w: w.display_order)
spec_list = []
if len(self.standalone.items()) > 0:
spec_list += self.standalone.specs
spec_list.sort(key=lambda w: w.display_order)
return spec_list
def get_categories(self) -> List[WorkflowSpecCategory]: