Repository: incubator-airflow Updated Branches: refs/heads/master 0ade066f4 -> f516c9ee5
[AIRFLOW-1078] Fix latest_runs endpoint for old flask versions Old versions of flask (<0.11) dont support jsonify on arrays due an ECMAScript 4 vulnerability in older browsers. This should work on old flask versions as well. Closes #2224 from saguziel/aguziel-fix-homepage Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/f516c9ee Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/f516c9ee Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/f516c9ee Branch: refs/heads/master Commit: f516c9ee5325a4b9f8501ef0d69fac38e7d1edbe Parents: 0ade066 Author: Alex Guziel <[email protected]> Authored: Fri Apr 7 19:26:35 2017 +0200 Committer: Bolke de Bruin <[email protected]> Committed: Fri Apr 7 19:26:35 2017 +0200 ---------------------------------------------------------------------- airflow/www/api/experimental/endpoints.py | 2 +- airflow/www/templates/airflow/dags.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/f516c9ee/airflow/www/api/experimental/endpoints.py ---------------------------------------------------------------------- diff --git a/airflow/www/api/experimental/endpoints.py b/airflow/www/api/experimental/endpoints.py index 63355c7..2dacd6c 100644 --- a/airflow/www/api/experimental/endpoints.py +++ b/airflow/www/api/experimental/endpoints.py @@ -130,4 +130,4 @@ def latest_dag_runs(): 'dag_run_url': url_for('airflow.graph', dag_id=dagrun.dag_id, execution_date=dagrun.execution_date) }) - return jsonify(payload) + return jsonify(items=payload) # old flask versions dont support jsonifying arrays http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/f516c9ee/airflow/www/templates/airflow/dags.html ---------------------------------------------------------------------- diff --git a/airflow/www/templates/airflow/dags.html b/airflow/www/templates/airflow/dags.html index 5abbc4b..a129721 100644 --- a/airflow/www/templates/airflow/dags.html +++ b/airflow/www/templates/airflow/dags.html @@ -226,7 +226,7 @@ }); }); $.getJSON("{{ url_for('api_experimental.latest_dag_runs') }}", function(data) { - $.each(data, function() { + $.each(data["items"], function() { var link = $("<a>", { href: this.dag_run_url, text: this.execution_date
