mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Added source version description
Links copied version to original with author information. Author is not passed on version as it might require admin privileges.
This commit is contained in:
parent
a9af964f4c
commit
0b6c0f3de9
1 changed files with 22 additions and 1 deletions
|
|
@ -1045,10 +1045,15 @@ class ProjectPushItemProcess:
|
|||
copied_tags = self._get_transferable_tags(src_version_entity)
|
||||
copied_status = self._get_transferable_status(src_version_entity)
|
||||
|
||||
description = self._create_src_version_description(
|
||||
self._item.src_project_name,
|
||||
src_version_entity
|
||||
)
|
||||
dst_attrib["description"] = dst_attrib.get("description", "") + description
|
||||
|
||||
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"),
|
||||
|
|
@ -1372,6 +1377,22 @@ 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"]
|
||||
version_url = f"{ayon_api.get_base_url()}/projects/{src_project_name}/products?project={src_project_name}&type=version&id={src_version_id}" # noqa: E501
|
||||
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