Skip to content

Commit

Permalink
capture 'TaskNotSetError'
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Dec 10, 2024
1 parent b995c51 commit 5d91c9b
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions client/ayon_core/tools/push_to_project/models/integrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from ayon_core.pipeline.version_start import get_versioning_start
from ayon_core.pipeline.template_data import get_template_data
from ayon_core.pipeline.publish import get_publish_template_name
from ayon_core.pipeline.create import get_product_name
from ayon_core.pipeline.create import get_product_name, TaskNotSetError

UNKNOWN = object()

Expand Down Expand Up @@ -823,15 +823,23 @@ def _determine_product_name(self):
task_name = task_info["name"]
task_type = task_info["taskType"]

product_name = get_product_name(
self._item.dst_project_name,
task_name,
task_type,
self.host_name,
product_type,
self._item.variant,
project_settings=self._project_settings
)
try:
product_name = get_product_name(
self._item.dst_project_name,
task_name,
task_type,
self.host_name,
product_type,
self._item.variant,
project_settings=self._project_settings
)
except TaskNotSetError:
self._status.set_failed(
"Product name template requires task name."
" Please select target task to continue."
)
raise PushToProjectError(self._status.fail_reason)

self._log_info(
f"Push will be integrating to product with name '{product_name}'"
)
Expand Down

0 comments on commit 5d91c9b

Please sign in to comment.