[ 
https://issues.apache.org/jira/browse/AIRFLOW-3233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16690503#comment-16690503
 ] 

ASF GitHub Bot commented on AIRFLOW-3233:
-----------------------------------------

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]


> Dag deletion in the UI doesn't work
> -----------------------------------
>
>                 Key: AIRFLOW-3233
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3233
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: webserver
>    Affects Versions: 1.10.0
>            Reporter: Dan Davydov
>            Assignee: Dan Davydov
>            Priority: Major
>
> Dag deletion in the UI doesn't work, DAGs can only be deleted if the DAG 
> doesn't exist in the DAGBag, but if the DAG doesn't exist in the DAGBag the 
> deletion URL gets passed an empty DAG id.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to