def get_sequence_subscriptions(task): """ Return all sequence subscriptions for given task. It returns something only if the task is related to a shot of which the sequence has a subscription. """ sequence_subscriptions = [] entity = Entity.get(task["entity_id"]) if entity is not None and entity.parent_id is not None: sequence_subscriptions = Subscription.get_all_by( task_type_id=task["task_type_id"], entity_id=entity.parent_id) return sequence_subscriptions
def get_task_subscriptions(task): """ Return all notification subscriptions related to given task. """ return Subscription.get_all_by(task_id=task["id"])