airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject incubator-airflow git commit: [AIRFLOW-1078] Fix latest_runs endpoint for old flask versions
Date Fri, 07 Apr 2017 17:26:43 GMT
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 <alex.guziel@airbnb.com>
Authored: Fri Apr 7 19:26:35 2017 +0200
Committer: Bolke de Bruin <bolke@xs4all.nl>
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


Mime
View raw message