Skip to content

Commit

Permalink
Revert back task_name to task
Browse files Browse the repository at this point in the history
Publisher expects only 'task'
  • Loading branch information
kalisp committed Jul 31, 2024
1 parent 314fb65 commit 50b1484
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ayon_unreal.api.plugin import UnrealBaseAutoCreator
from ayon_unreal.api.pipeline import create_publish_instance, imprint


class UnrealPublishCommit(UnrealBaseAutoCreator):
"""Auto creator to mark current version of project as published.
Expand All @@ -17,7 +18,7 @@ class UnrealPublishCommit(UnrealBaseAutoCreator):
product_type = "changelist_metadata"
label = "Publish Changelist Metadata"

default_variant = ""
default_variant = "Main"

def create(self, options=None):
existing_instance = None
Expand All @@ -33,7 +34,6 @@ def create(self, options=None):
task_entity = context.get_current_task_entity()
task_name = task_entity["name"]
host_name = context.host_name

if existing_instance is None:

product_name = self.get_product_name(
Expand All @@ -43,10 +43,11 @@ def create(self, options=None):

data = {
"folderPath": folder_path,
"task_name": task_name,
"task": task_name,
"variant": self.default_variant,
"productName": product_name
}

data.update(self.get_dynamic_data(
project_name,
folder_entity,
Expand Down Expand Up @@ -76,14 +77,12 @@ def create(self, options=None):

elif (
existing_instance["folderPath"] != folder_path
# 'task' just for backward compatibility
or (existing_instance.get("task") or
existing_instance["task_name"]) != task_name
or existing_instance.get("task") != task_name
):
product_name = self.get_product_name(
project_name, folder_entity, task_entity, self.default_variant,
host_name
)
existing_instance["folderPath"] = folder_path
existing_instance["task_name"] = task_name
existing_instance["task"] = task_name
existing_instance["productName"] = product_name

0 comments on commit 50b1484

Please sign in to comment.