Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #736 from pypeclub/feature/725-shot-asset-build-tr…
Browse files Browse the repository at this point in the history
…igger-status

Shot asset build trigger status
  • Loading branch information
mkolar authored Nov 20, 2020
2 parents 14f3488 + df1d3f3 commit b7c734d
Show file tree
Hide file tree
Showing 2 changed files with 408 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pype/modules/ftrack/events/event_next_task_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,26 @@ def filter_entities_info(self, session, event):

first_filtered_entities.append(entity_info)

if not first_filtered_entities:
return first_filtered_entities

status_ids = [
entity_info["changes"]["statusid"]["new"]
for entity_info in first_filtered_entities
]
statuses_by_id = self.get_statuses_by_id(
session, status_ids=status_ids
)
# Make sure `entity_type` is "Task"
task_object_type = session.query(
"select id, name from ObjectType where name is \"Task\""
).one()

# Care only about tasks having status with state `Done`
filtered_entities = []
for entity_info in first_filtered_entities:
if entity_info["objectTypeId"] != task_object_type["id"]:
continue
status_id = entity_info["changes"]["statusid"]["new"]
status_entity = statuses_by_id[status_id]
if status_entity["state"]["name"].lower() == "done":
Expand Down
Loading

0 comments on commit b7c734d

Please sign in to comment.