mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
added docstring and settings_key
This commit is contained in:
parent
48aa0f215e
commit
ebb9e25909
1 changed files with 8 additions and 0 deletions
|
|
@ -5,6 +5,8 @@ from pype.modules.ftrack import BaseEvent
|
|||
class TaskToVersionStatus(BaseEvent):
|
||||
"""Changes status of task's latest AssetVersions on its status change."""
|
||||
|
||||
settings_key = "status_task_to_version"
|
||||
|
||||
# Attribute for caching session user id
|
||||
_cached_user_id = None
|
||||
|
||||
|
|
@ -15,6 +17,12 @@ class TaskToVersionStatus(BaseEvent):
|
|||
return ",".join(["\"{}\"".format(key) for key in keys])
|
||||
|
||||
def is_event_invalid(self, session, event):
|
||||
"""Skip task status changes for session user changes.
|
||||
|
||||
It is expected that there may be another event handler that set
|
||||
version status to task in that case skip all events caused by same
|
||||
user as session has to avoid infinite loop of status changes.
|
||||
"""
|
||||
# Cache user id of currently running session
|
||||
if self._cached_user_id is None:
|
||||
session_user_entity = session.query(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue