mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge branch 'develop' into bugfix/902-ay-3875_ayon-integrate-hero-for-review
This commit is contained in:
commit
826d22b166
1 changed files with 38 additions and 1 deletions
|
|
@ -1045,10 +1045,23 @@ class ProjectPushItemProcess:
|
|||
copied_tags = self._get_transferable_tags(src_version_entity)
|
||||
copied_status = self._get_transferable_status(src_version_entity)
|
||||
|
||||
description_parts = []
|
||||
dst_attr_description = dst_attrib.get("description")
|
||||
if dst_attr_description:
|
||||
description_parts.append(dst_attr_description)
|
||||
|
||||
description = self._create_src_version_description(
|
||||
self._item.src_project_name,
|
||||
src_version_entity
|
||||
)
|
||||
if description:
|
||||
description_parts.append(description)
|
||||
|
||||
dst_attrib["description"] = "\n\n".join(description_parts)
|
||||
|
||||
version_entity = new_version_entity(
|
||||
dst_version,
|
||||
product_id,
|
||||
author=src_version_entity["author"],
|
||||
status=copied_status,
|
||||
tags=copied_tags,
|
||||
task_id=self._task_info.get("id"),
|
||||
|
|
@ -1370,6 +1383,30 @@ class ProjectPushItemProcess:
|
|||
return copied_status["name"]
|
||||
return None
|
||||
|
||||
def _create_src_version_description(
|
||||
self,
|
||||
src_project_name: str,
|
||||
src_version_entity: dict[str, Any]
|
||||
) -> str:
|
||||
"""Creates description text about source version."""
|
||||
src_version_id = src_version_entity["id"]
|
||||
src_author = src_version_entity["author"]
|
||||
query = "&".join([
|
||||
f"project={src_project_name}",
|
||||
"type=version",
|
||||
f"id={src_version_id}"
|
||||
])
|
||||
version_url = (
|
||||
f"{ayon_api.get_base_url()}"
|
||||
f"/projects/{src_project_name}/products?{query}"
|
||||
)
|
||||
description = (
|
||||
f"Version copied from from {version_url} "
|
||||
f"created by '{src_author}', "
|
||||
)
|
||||
|
||||
return description
|
||||
|
||||
|
||||
class IntegrateModel:
|
||||
def __init__(self, controller):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue