From 2aa5dd0174f11ffe4e2491d77739d4e5f7469327 Mon Sep 17 00:00:00 2001 From: alexjanousekGSA Date: Fri, 15 Nov 2024 11:55:16 -0500 Subject: [PATCH] Added back removed code --- app/main/views/index.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/main/views/index.py b/app/main/views/index.py index 0a1635d67..5116cb634 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -18,13 +18,18 @@ from app.main.views.sub_navigation_dictionaries import ( from app.utils.user import user_is_logged_in from notifications_utils.url_safe_token import generate_token - # Hook to check for feature flags @main.before_request -def check_guidance_feature(): +def check_feature_flags(): if ( - request.path.startswith("/guides/best-practices") - and not current_app.config["FEATURE_BEST_PRACTICES_ENABLED"] + request.path.startswith("/best-practices") + and not current_app.config.get("FEATURE_BEST_PRACTICES_ENABLED", False) + ): + abort(404) + + if ( + request.path.startswith("/about") + and not current_app.config.get("FEATURE_ABOUT_PAGE_ENABLED", False) ): abort(404)