mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-16 18:13:54 -05:00
Added feature flag for route
This commit is contained in:
@@ -161,7 +161,7 @@
|
|||||||
"filename": "app/config.py",
|
"filename": "app/config.py",
|
||||||
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
|
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
|
||||||
"is_verified": false,
|
"is_verified": false,
|
||||||
"line_number": 121,
|
"line_number": 125,
|
||||||
"is_secret": false
|
"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"
|
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):
|
def _s3_credentials_from_env(bucket_prefix):
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -19,14 +19,18 @@ from app.utils.user import user_is_logged_in
|
|||||||
from notifications_utils.url_safe_token import generate_token
|
from notifications_utils.url_safe_token import generate_token
|
||||||
|
|
||||||
|
|
||||||
# Hook to check for guidance routes
|
# Hook to check for feature flags
|
||||||
@main.before_request
|
@main.before_request
|
||||||
def check_guidance_feature():
|
def check_feature_flags():
|
||||||
current_app.logger.warning("best practices 1234")
|
|
||||||
current_app.logger.warning(current_app.config["FEATURE_BEST_PRACTICES_ENABLED"])
|
|
||||||
if (
|
if (
|
||||||
request.path.startswith("/best-practices")
|
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)
|
abort(404)
|
||||||
|
|
||||||
@@ -270,7 +274,6 @@ def benchmark_performance():
|
|||||||
|
|
||||||
|
|
||||||
@main.route("/about")
|
@main.route("/about")
|
||||||
@user_is_logged_in
|
|
||||||
def about_notify():
|
def about_notify():
|
||||||
return render_template(
|
return render_template(
|
||||||
"views/about/about.html",
|
"views/about/about.html",
|
||||||
|
|||||||
Reference in New Issue
Block a user