mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
handle empty project in 'get_project_product_types'
This commit is contained in:
parent
d2ee1b91f5
commit
7a7a4b1e9a
2 changed files with 7 additions and 1 deletions
|
|
@ -531,6 +531,9 @@ class FrontendLoaderController(_BaseLoaderController):
|
|||
|
||||
Product types have defined if are checked for filtering or not.
|
||||
|
||||
Args:
|
||||
project_name (Union[str, None]): Project name.
|
||||
|
||||
Returns:
|
||||
list[ProductTypeItem]: List of product type items for a project.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -179,12 +179,15 @@ class ProductsModel:
|
|||
"""Product type items for project.
|
||||
|
||||
Args:
|
||||
project_name (str): Project name.
|
||||
project_name (Union[str, None]): Project name.
|
||||
|
||||
Returns:
|
||||
list[ProductTypeItem]: Product type items.
|
||||
"""
|
||||
|
||||
if not project_name:
|
||||
return []
|
||||
|
||||
cache = self._product_type_items_cache[project_name]
|
||||
if not cache.is_valid:
|
||||
product_types = ayon_api.get_project_product_types(project_name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue