Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions airflow/www_rbac/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2528,12 +2528,22 @@ class DagRunModelView(AirflowModelView):
'run_id': wwwutils.dag_run_link,
}

@staticmethod
def notify(items, session):
for item in items:
dag_run = session.query(DagRun).filter(
DagRun.dag_id == item.dag_id,
DagRun.execution_date == item.execution_date
).one()
dagbag.get_dag(item.dag_id).handle_callback(dag_run, success=False, reason='deleted', session=session)
Comment on lines +2533 to +2538
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get the result using a single query?


@action('muldelete', "Delete", "Are you sure you want to delete selected records?",
single=False)
@has_dag_access(can_dag_edit=True)
@provide_session
def action_muldelete(self, items, session=None):
self.datamodel.delete_all(items)
self.notify(items, session)
self.update_redirect()
dirty_ids = []
for item in items:
Expand Down