ashb closed pull request #4069: [AIRFLOW-3233] Fix deletion of DAGs in the UI
URL: https://github.com/apache/incubator-airflow/pull/4069
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/www/templates/airflow/dags.html 
b/airflow/www/templates/airflow/dags.html
index 0a7a6ec2a4..642a856019 100644
--- a/airflow/www/templates/airflow/dags.html
+++ b/airflow/www/templates/airflow/dags.html
@@ -191,11 +191,11 @@ <h2>DAGs</h2>
                 </a>
 
                 <!-- Delete -->
-                <a href="{{ url_for('airflow.delete', dag_id=dag.dag_id) }}"
-                  onclick="return confirmDeleteDag('{{ dag.safe_dag_id }}')">
+                <!-- Use dag_id instead of dag.dag_id, because the DAG might 
not exist in the webserver's DagBag -->
+                <a href="{{ url_for('airflow.delete', dag_id=dag_id) }}"
+                  onclick="return confirmDeleteDag('{{ dag_id }}')">
                    <span class="glyphicon glyphicon-remove-circle" 
style="color:red" aria-hidden="true" data-original-title="Delete Dag"></span>
                 </a>
-
                 </td>
             </tr>
         {% endfor %}
diff --git a/airflow/www_rbac/templates/airflow/dags.html 
b/airflow/www_rbac/templates/airflow/dags.html
index 5f492780d5..7d4fb5678d 100644
--- a/airflow/www_rbac/templates/airflow/dags.html
+++ b/airflow/www_rbac/templates/airflow/dags.html
@@ -192,9 +192,10 @@ <h2>DAGs</h2>
                 </a>
 
                 <!-- Delete -->
-                <a href="{{ url_for('Airflow.delete', dag_id=dag.dag_id) }}"
-                   onclick="return confirmDeleteDag('{{ dag.safe_dag_id }}')">
-                  <span class="glyphicon glyphicon-remove-circle" 
style="color:red" aria-hidden="true" data-original-title="Delete Dag"></span>
+                <!-- Use dag_id instead of dag.dag_id, because the DAG might 
not exist in the webserver's DagBag -->
+                <a href="{{ url_for('Airflow.delete', dag_id=dag_id) }}"
+                  onclick="return confirmDeleteDag('{{ dag_id }}')">
+                   <span class="glyphicon glyphicon-remove-circle" 
style="color:red" aria-hidden="true" data-original-title="Delete Dag"></span>
                 </a>
                 </td>
             </tr>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to