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

Reformstudios patch fix shotgun descriptor incorrect system name behaviour #721

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 7 additions & 3 deletions python/tank/descriptor/io_descriptor/shotgun_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
self._validate_descriptor(
descriptor_dict,
required=["type", "entity_type", "id", "version", "field"],
optional=[],
optional=["system_name"],
)

# convert to int
Expand Down Expand Up @@ -132,6 +132,7 @@
self._bundle_type = bundle_type
self._entity_type = descriptor_dict.get("entity_type")
self._field = descriptor_dict.get("field")
self._system_name = descriptor_dict.get("system_name")

# ensure version is an int if specified
try:
Expand Down Expand Up @@ -184,8 +185,11 @@
name = self._name

elif self._mode == self._MODE_ID_BASED:
# e.g. 'PipelineConfiguration_1234'
name = "%s_%s" % (self._entity_type, self._entity_id)
if self._system_name:
name = self._system_name

Check warning on line 189 in python/tank/descriptor/io_descriptor/shotgun_entity.py

View check run for this annotation

Codecov / codecov/patch

python/tank/descriptor/io_descriptor/shotgun_entity.py#L189

Added line #L189 was not covered by tests
else:
# e.g. 'PipelineConfiguration_1234'
name = "%s_%s" % (self._entity_type, self._entity_id)

return filesystem.create_valid_filename(name)

Expand Down