Merge pull request #2190 from pypeclub/bugfix/source_validation_expect_repres

StandalonePublisher: Source validator don't expect representations
This commit is contained in:
Jakub Trllo 2021-10-29 16:02:29 +02:00 committed by GitHub
commit d2e5049db8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,15 +22,15 @@ class ValidateSources(pyblish.api.InstancePlugin):
def process(self, instance):
self.log.info("instance {}".format(instance.data))
for repr in instance.data["representations"]:
for repre in instance.data.get("representations") or []:
files = []
if isinstance(repr["files"], str):
files.append(repr["files"])
if isinstance(repre["files"], str):
files.append(repre["files"])
else:
files = list(repr["files"])
files = list(repre["files"])
for file_name in files:
source_file = os.path.join(repr["stagingDir"],
source_file = os.path.join(repre["stagingDir"],
file_name)
if not os.path.exists(source_file):