From 9023943bb1484eb8659359587db4ed3290bb7899 Mon Sep 17 00:00:00 2001 From: alexjanousekGSA Date: Tue, 19 Nov 2024 10:49:30 -0500 Subject: [PATCH] Fixed a few errors --- app/__init__.py | 17 ++++++----------- app/templates/components/header.html | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 43a60abab..d59ad198b 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -168,17 +168,12 @@ def create_app(application): @application.context_processor def inject_feature_flags(): - feature_best_practices_enabled = application.config[ - "FEATURE_BEST_PRACTICES_ENABLED" - ] - return dict(FEATURE_BEST_PRACTICES_ENABLED=feature_best_practices_enabled) - - @application.context_processor - def inject_feature_flags(): - feature_best_practices_enabled = application.config[ - "FEATURE_ABOUT_PAGE_ENABLED" - ] - return dict(FEATURE_ABOUT_PAGE_ENABLED=feature_best_practices_enabled) + feature_best_practices_enabled = application.config.get("FEATURE_BEST_PRACTICES_ENABLED", False) + feature_about_page_enabled = application.config.get("FEATURE_ABOUT_PAGE_ENABLED", False) + return dict( + FEATURE_BEST_PRACTICES_ENABLED=feature_best_practices_enabled, + FEATURE_ABOUT_PAGE_ENABLED=feature_about_page_enabled, + ) @application.context_processor def inject_initial_signin_url(): diff --git a/app/templates/components/header.html b/app/templates/components/header.html index 012b3b9c1..a1c1de389 100644 --- a/app/templates/components/header.html +++ b/app/templates/components/header.html @@ -56,7 +56,7 @@ secondary_navigation.is_selected('settings')}, {% endif %} - {% if not current_user.is_authenticated and FEATURE_ABOUT_PAGE_ENABLED %} + {% if not current_user.is_authenticated and FEATURE_ABOUT_PAGE_ENABLED and request.path == '/about'%}