Merge pull request #2428 from GSA/remove-about-feature-flag

This commit is contained in:
Beverly Nguyen
2025-03-20 16:14:16 -07:00
committed by GitHub
5 changed files with 16 additions and 17 deletions

View File

@@ -169,14 +169,15 @@ def _csp(config):
def create_app(application):
@application.context_processor
def inject_feature_flags():
feature_about_page_enabled = application.config.get(
"FEATURE_ABOUT_PAGE_ENABLED", False
)
return dict(
FEATURE_ABOUT_PAGE_ENABLED=feature_about_page_enabled,
)
# @application.context_processor
# def inject_feature_flags():
# this is where feature flags can be easily added as a dictionary within context
# feature_about_page_enabled = application.config.get(
# "FEATURE_ABOUT_PAGE_ENABLED", False
# )
# return dict(
# FEATURE_ABOUT_PAGE_ENABLED=feature_about_page_enabled,
# )
@application.context_processor
def inject_initial_signin_url():

View File

@@ -88,8 +88,6 @@ class Config(object):
],
}
FEATURE_ABOUT_PAGE_ENABLED = getenv("FEATURE_ABOUT_PAGE_ENABLED", "false") == "true"
def _s3_credentials_from_env(bucket_prefix):
return {

View File

@@ -23,10 +23,11 @@ from app.utils.user import user_is_logged_in
# Hook to check for feature flags
@main.before_request
def check_feature_flags():
if request.path.startswith("/about") and not current_app.config.get(
"FEATURE_ABOUT_PAGE_ENABLED", False
):
abort(404)
# Placeholder for future feature flag checks
# Example:
# if request.path.startswith("/some-feature") and not current_app.config.get("FEATURE_SOME_FEATURE_ENABLED", False):
# abort(404)
pass
@main.route("/test/feature-flags")