Merge pull request #2782 from pypeclub/bugfix/OP-2726_Webpublisher-Ftrack-review-burnin-displaying-pypeclub

Webpublisher: Fix use ftrack username in burnins
This commit is contained in:
Petr Kalis 2022-02-23 15:53:12 +01:00 committed by GitHub
commit 6a39f65bb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View file

@ -33,7 +33,6 @@ class CollectUsername(pyblish.api.ContextPlugin):
def process(self, context):
self.log.info("CollectUsername")
os.environ["FTRACK_API_USER"] = os.environ["FTRACK_BOT_API_USER"]
os.environ["FTRACK_API_KEY"] = os.environ["FTRACK_BOT_API_KEY"]
@ -57,7 +56,12 @@ class CollectUsername(pyblish.api.ContextPlugin):
if not user:
raise ValueError(
"Couldn't find user with {} email".format(user_email))
username = user[0].get("username")
user = user[0]
username = user.get("username")
self.log.debug("Resolved ftrack username:: {}".format(username))
os.environ["FTRACK_API_USER"] = username
burnin_name = username
if '@' in burnin_name:
burnin_name = burnin_name[:burnin_name.index('@')]
os.environ["WEBPUBLISH_OPENPYPE_USERNAME"] = burnin_name

View file

@ -478,6 +478,12 @@ class ExtractBurnin(openpype.api.Extractor):
"frame_end_handle": frame_end_handle
}
# use explicit username for webpublishes as rewriting
# OPENPYPE_USERNAME might have side effects
webpublish_user_name = os.environ.get("WEBPUBLISH_OPENPYPE_USERNAME")
if webpublish_user_name:
burnin_data["username"] = webpublish_user_name
self.log.debug(
"Basic burnin_data: {}".format(json.dumps(burnin_data, indent=4))
)