File tree Expand file tree Collapse file tree
src/airflow/providers/fab
auth_manager/cli_commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242@cache
4343def _return_appbuilder (app : Flask , db ) -> AirflowAppBuilder :
4444 """Return an appbuilder instance for the given app."""
45- init_appbuilder (app , enable_plugins = False )
45+ init_appbuilder (app , False , db )
4646 init_plugins (app )
4747 init_airflow_session_interface (app , db )
4848 return app .appbuilder # type: ignore[attr-defined]
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ def create_app(enable_plugins: bool):
9494 init_api_auth (flask_app )
9595
9696 with flask_app .app_context ():
97- init_appbuilder (flask_app , enable_plugins = enable_plugins )
97+ init_appbuilder (flask_app , enable_plugins , db )
9898 init_error_handlers (flask_app )
9999 # In two scenarios a Flask application can be created:
100100 # - To support Airflow 2 plugins relying on Flask (``enable_plugins`` is True)
Original file line number Diff line number Diff line change @@ -590,13 +590,13 @@ def _process_inner_views(self):
590590 view .get_init_inner_views ().append (v )
591591
592592
593- def init_appbuilder (app : Flask , enable_plugins : bool ) -> AirflowAppBuilder :
593+ def init_appbuilder (app : Flask , enable_plugins : bool , db ) -> AirflowAppBuilder :
594594 """Init `Flask App Builder <https://flask-appbuilder.readthedocs.io/en/latest/>`__."""
595595 if settings .Session is None :
596596 raise RuntimeError ("Session not configured. Call configure_orm() first." )
597597 return AirflowAppBuilder (
598598 app = app ,
599- session = settings . Session () ,
599+ session = db . session ,
600600 base_template = "airflow/main.html" ,
601601 enable_plugins = enable_plugins ,
602602 )
Original file line number Diff line number Diff line change 1- 1074f052d6e1b982be7b333efd08d4c28ede680aa3b135504f0e0b519443205f
1+ 5fafa901a5841386df6801a90f1b166ed68d6b7b8ac095e840275e5a82d88092
You can’t perform that action at this time.
0 commit comments