jens-scheffler-bosch commented on code in PR #31301:
URL: https://github.com/apache/airflow/pull/31301#discussion_r1195922018
##########
airflow/www/views.py:
##########
@@ -1877,20 +1877,61 @@ def delete(self):
@provide_session
def trigger(self, session: Session = NEW_SESSION):
"""Triggers DAG Run."""
- dag_id = request.values["dag_id"]
- run_id = request.values.get("run_id", "")
+ dag_id = request.values.get("dag_id")
origin = get_safe_url(request.values.get("origin"))
+ if not dag_id:
+ flash("No dag_id provided for trigger form.", "error")
Review Comment:
Yes, I also thought about a crash screen. But then I thought not adding
complexity because the other routes when an invalid or broken DAG ID is given
also do the same.
I added the validation here actually to ensure that no follow-up error
appear and to validate early before any other data is processed so that we can
be sure we have a string. (Follow-up code loads stuff from DB based on this and
follow-up errors might be strange)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]