You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/29 17:51:23 UTC

[GitHub] [airflow] jedcunningham commented on a diff in pull request #25402: Refactor DAG pages to be consistent

jedcunningham commented on code in PR #25402:
URL: https://github.com/apache/airflow/pull/25402#discussion_r933496392


##########
airflow/www/views.py:
##########
@@ -1237,31 +1237,27 @@ def legacy_code(self):
     @provide_session
     def code(self, dag_id, session=None):
         """Dag Code."""
-        all_errors = ""
-        dag_orm = None
+        dag = get_airflow_app().dag_bag.get_dag(dag_id, session=session)
+        dag_model = DagModel.get_dagmodel(dag_id, session=session)
+        if not dag:
+            flash(f'DAG "{dag_id}" seems to be missing.', "error")
+            return redirect(url_for('Airflow.index'))

Review Comment:
   Yeah, if you look down we were passing the orm dag as both the orm dag and the "normal" dag. This was doing the wrong thing before, even if it did work. That might mean we can simplify further, but that'll be another time.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org