diff --git a/airflow/models/dag.py b/airflow/models/dag.py index ad129edf68072..89b79b98b5390 100644 --- a/airflow/models/dag.py +++ b/airflow/models/dag.py @@ -2819,6 +2819,10 @@ def get_last_dagrun(self, session=NEW_SESSION, include_externally_triggered=Fals self.dag_id, session=session, include_externally_triggered=include_externally_triggered ) + def get_is_paused(self, *, session: Optional[Session] = None) -> bool: + """Provide interface compatibility to 'DAG'.""" + return self.is_paused + @staticmethod @provide_session def get_paused_dag_ids(dag_ids: List[str], session: Session = NEW_SESSION) -> Set[str]: diff --git a/airflow/www/app.py b/airflow/www/app.py index efafcd9ede834..bd7a0e25a79a0 100644 --- a/airflow/www/app.py +++ b/airflow/www/app.py @@ -114,7 +114,8 @@ def create_app(config=None, testing=False): init_robots(flask_app) - Cache(app=flask_app, config={'CACHE_TYPE': 'filesystem', 'CACHE_DIR': gettempdir()}) + cache_config = {'CACHE_TYPE': 'flask_caching.backends.filesystem', 'CACHE_DIR': gettempdir()} + Cache(app=flask_app, config=cache_config) init_flash_views(flask_app) diff --git a/airflow/www/templates/airflow/dag.html b/airflow/www/templates/airflow/dag.html index 1ed60ecf71574..7d0cbb923e30a 100644 --- a/airflow/www/templates/airflow/dag.html +++ b/airflow/www/templates/airflow/dag.html @@ -27,6 +27,8 @@ {% endblock %} +{% set dag_is_paused = dag.get_is_paused() %} + {% block head_meta %} {{ super() }} @@ -36,7 +38,7 @@ - + {% if dag_model is defined and dag_model.next_dagrun_create_after is defined and dag_model.next_dagrun_create_after is not none %} @@ -70,11 +72,11 @@