mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-10 15:13:40 -05:00
Added feature flag for route
This commit is contained in:
@@ -161,7 +161,7 @@
|
||||
"filename": "app/config.py",
|
||||
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
|
||||
"is_verified": false,
|
||||
"line_number": 121,
|
||||
"line_number": 125,
|
||||
"is_secret": false
|
||||
}
|
||||
],
|
||||
@@ -684,5 +684,5 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"generated_at": "2024-10-29T19:28:03Z"
|
||||
"generated_at": "2024-11-14T15:53:44Z"
|
||||
}
|
||||
|
||||
@@ -91,6 +91,10 @@ class Config(object):
|
||||
getenv("FEATURE_BEST_PRACTICES_ENABLED", "false") == "true"
|
||||
)
|
||||
|
||||
FEATURE_ABOUT_PAGE_ENABLED = (
|
||||
getenv("FEATURE_ABOUT_PAGE_ENABLED", "false") == "true"
|
||||
)
|
||||
|
||||
|
||||
def _s3_credentials_from_env(bucket_prefix):
|
||||
return {
|
||||
|
||||
@@ -19,14 +19,18 @@ from app.utils.user import user_is_logged_in
|
||||
from notifications_utils.url_safe_token import generate_token
|
||||
|
||||
|
||||
# Hook to check for guidance routes
|
||||
# Hook to check for feature flags
|
||||
@main.before_request
|
||||
def check_guidance_feature():
|
||||
current_app.logger.warning("best practices 1234")
|
||||
current_app.logger.warning(current_app.config["FEATURE_BEST_PRACTICES_ENABLED"])
|
||||
def check_feature_flags():
|
||||
if (
|
||||
request.path.startswith("/best-practices")
|
||||
and not current_app.config["FEATURE_BEST_PRACTICES_ENABLED"]
|
||||
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)
|
||||
|
||||
@@ -270,7 +274,6 @@ def benchmark_performance():
|
||||
|
||||
|
||||
@main.route("/about")
|
||||
@user_is_logged_in
|
||||
def about_notify():
|
||||
return render_template(
|
||||
"views/about/about.html",
|
||||
|
||||
Reference in New Issue
Block a user