ftrack's post launch hook do not trigger start.timer action but trigger start of the timer on it's own

This commit is contained in:
iLLiCiTiT 2020-12-16 17:39:29 +01:00
parent 3674bc8f94
commit dc33f3d842

View file

@ -176,22 +176,10 @@ class PostFtrackHook(PostLaunchHook):
)
return
source = {
"user": {
"id": user_entity["id"],
"username": user_entity["username"]
}
}
event_data = {
"actionIdentifier": "start.timer",
"selection": [{"entityId": entity["id"], "entityType": "task"}]
}
session.event_hub.publish(
_ftrack_api.event.base.Event(
topic="ftrack.action.launch",
data=event_data,
source=source
),
on_error="ignore"
)
self.log.debug("Timer start triggered successfully.")
try:
user_entity.start_timer(entity, force=True)
session.commit()
self.log.debug("Timer start triggered successfully.")
except Exception:
self.log.warning("Couldn't trigger Ftrack timer.", exc_info=True)