Skip to content

Commit

Permalink
Merge pull request apache#274 from airbnb/task_missing
Browse files Browse the repository at this point in the history
Error message when task is gone on task details page
  • Loading branch information
mistercrunch committed Aug 19, 2015
2 parents 0172300 + b6c8b51 commit 70d68bb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion airflow/www/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,12 @@ def task(self):
dttm = dateutil.parser.parse(execution_date)
form = DateTimeForm(data={'execution_date': dttm})
dag = dagbag.get_dag(dag_id)
if not dag or task_id not in dag.task_ids:
flash(
"Task [{}.{}] doesn't seem to exist"
" at the moment".format(dag_id, task_id),
"error")
return redirect('/admin/')
task = dag.get_task(task_id)
task = copy.copy(task)
task.resolve_template_files()
Expand Down Expand Up @@ -1096,7 +1102,7 @@ def graph(self):
dag = dagbag.get_dag(dag_id)
if dag_id not in dagbag.dags:
flash('DAG "{0}" seems to be missing.'.format(dag_id), "error")
return redirect('/admin/dagmodel/')
return redirect('/admin/')

root = request.args.get('root')
if root:
Expand Down

0 comments on commit 70d68bb

Please sign in to comment.