def handle_cycle_task_group_object_task_put(obj):
    if inspect(obj).attrs._access_control_list.history.has_changes():
        types = [
            "cycle_task_reassigned", "cycle_created", "manual_cycle_created"
        ]
        if not pusher.notification_exists_for(obj, notification_names=types):
            pusher.push(obj,
                        pusher.get_notification_type("cycle_task_reassigned"))
    if inspect(obj).attrs.end_date.history.has_changes() and not obj.is_done:
        # if you change end date to past than overdue
        # notification should be send today
        pusher.update_or_create_notifications(
            obj, obj.end_date, get_notif_name_by_wf(obj.cycle.workflow),
            "cycle_task_due_today", "cycle_task_overdue")
Exemplo n.º 2
0
def handle_cycle_task_group_object_task_put(obj):
  if inspect(obj).attrs._access_control_list.history.has_changes():
    types = ["cycle_task_reassigned", "cycle_created", "manual_cycle_created"]
    if not pusher.notification_exists_for(obj, notification_names=types):
      pusher.push(obj, pusher.get_notification_type("cycle_task_reassigned"))
  if inspect(obj).attrs.end_date.history.has_changes() and not obj.is_done:
    # if you change end date to past than overdue
    # notification should be sent today
    pusher.update_or_create_notifications(
        obj,
        obj.end_date,
        get_notif_name_by_wf(obj.cycle.workflow),
        "cycle_task_due_today",
        "cycle_task_overdue")