Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AY-6740 CSV ingest: make Version column optional. #32

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions client/ayon_traypublisher/plugins/create/create_csv_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _get_row_value_with_validation(
# get column default value
column_default = column_data["default"]

if column_type in ["number", "decimal"] and column_default == 0:
if column_type in ["number", "decimal"] and column_default in (0, '0'):
column_default = None

# check if column value is not empty string
Expand Down Expand Up @@ -779,7 +779,11 @@ def _create_instances_from_csv_data(self, csv_dir: str, filename: str):
product_item.product_type,
product_item.variant
)
label: str = f"{folder_path}_{product_name}_v{version:>03}"

if version is not None:
label: str = f"{folder_path}_{product_name}_v{version:>03}"
else:
label: str = f"{folder_path}_{product_name}_v[next]"

repre_items: List[RepreItem] = product_item.repre_items
first_repre_item: RepreItem = repre_items[0]
Expand Down
8 changes: 4 additions & 4 deletions server/settings/creator_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel):
"type": "text",
"default": "",
"required_column": True,
"validation_pattern": "^([a-zA-Z\\:\\ 0-9#._\\\\/]*)$"
"validation_pattern": "^([a-zA-Z\\:\\ 0-9#\\-\\._\\\\/]*)$"
},
{
"name": "Folder Path",
Expand Down Expand Up @@ -215,8 +215,8 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel):
{
"name": "Version",
"type": "number",
"default": "1",
"required_column": True,
"default": "0",
BigRoy marked this conversation as resolved.
Show resolved Hide resolved
"required_column": False,
"validation_pattern": "^(\\d{1,3})$"
},
{
Expand All @@ -231,7 +231,7 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel):
"type": "text",
"default": "",
"required_column": False,
"validation_pattern": "^([a-zA-Z\\:\\ 0-9#._\\\\/]*)$"
"validation_pattern": "^([a-zA-Z\\:\\ 0-9#\\-\\._\\\\/]*)$"
},
{
"name": "Frame Start",
Expand Down