Skip to content

Commit

Permalink
Fix extra_links endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
tirkarthi committed May 16, 2022
1 parent 2f48271 commit a8df8ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3427,7 +3427,7 @@ def extra_links(self, session: "Session" = NEW_SESSION):
map_index = request.args.get('map_index', -1, type=int)
execution_date = request.args.get('execution_date')
link_name = request.args.get('link_name')
dttm = timezone.parse(execution_date)
dttm = _safe_parse_datetime(execution_date)
dag = current_app.dag_bag.get_dag(dag_id)

if not dag or task_id not in dag.task_ids:
Expand Down
4 changes: 4 additions & 0 deletions tests/www/views/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ def test_get_task_stats_from_query():
'dags/example_bash_operator/gantt?execution_date=invalid',
"Invalid datetime: 'invalid'",
),
(
'extra_links?execution_date=invalid',
"Invalid datetime: 'invalid'",
),
],
)
def test_invalid_dates(app, admin_client, url, content):
Expand Down

0 comments on commit a8df8ff

Please sign in to comment.