ashb commented on a change in pull request #6223: [AIRFLOW-5578] Adding the
ability to define custom IndexView
URL: https://github.com/apache/airflow/pull/6223#discussion_r343100499
##########
File path: airflow/www/blueprints.py
##########
@@ -18,10 +18,19 @@
# under the License.
#
from flask import Blueprint, redirect, url_for
+from flask_appbuilder import IndexView, expose
routes = Blueprint('routes', __name__)
+# Place any Flask Blueprint routes (non Flask-Appbuilder ones) here
[email protected]('/')
-def index():
- return redirect(url_for('Airflow.index'))
+# We can't put this into airflow.www.views because then we would have to
import the views module
+# inside airflow.www.app prior to the appbuilder object being set up.
+# This would break other code in views not using the cached_appbuilder()
function.
+
+
+class AirflowIndexView(IndexView):
Review comment:
I think this is better suited inside airflow/www/app.py
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services