You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bb...@apache.org on 2022/08/17 13:22:04 UTC

[airflow] branch main updated: Add origin request args when triggering a run (#25729)

This is an automated email from the ASF dual-hosted git repository.

bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 69663b245a Add origin request args when triggering a run (#25729)
69663b245a is described below

commit 69663b245a9a67b6f05324ce7b141a1bd9b05e0a
Author: Brent Bovenzi <br...@gmail.com>
AuthorDate: Wed Aug 17 14:21:30 2022 +0100

    Add origin request args when triggering a run (#25729)
    
    * Add origin request args when triggering a run
    
    * Update airflow/www/templates/airflow/dag.html
    
    Co-authored-by: Tzu-ping Chung <ur...@gmail.com>
    
    Co-authored-by: Tzu-ping Chung <ur...@gmail.com>
---
 airflow/www/templates/airflow/dag.html | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/airflow/www/templates/airflow/dag.html b/airflow/www/templates/airflow/dag.html
index 860dfaeb8f..848a9b8413 100644
--- a/airflow/www/templates/airflow/dag.html
+++ b/airflow/www/templates/airflow/dag.html
@@ -205,7 +205,12 @@
                   <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
                   <input type="hidden" name="dag_id" value="{{ dag.dag_id }}">
                   <input type="hidden" name="unpause" value="True">
-                  <input type="hidden" name="origin" value="{{ url_for(request.endpoint, dag_id=dag.dag_id) }}">
+                  <!-- for task instance detail pages, dag_id is still a query param -->
+                  {% if 'dag_id' in request.args %}
+                    <input type="hidden" name="origin" value="{{ url_for(request.endpoint, **request.args) }}">
+                  {% else %}
+                    <input type="hidden" name="origin" value="{{ url_for(request.endpoint, dag_id=dag.dag_id, **request.args) }}">
+                  {% endif %}
                   <button type="submit" class="dropdown-form-btn">Trigger DAG</button>
                 </form>
               </li>