mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-26 22:58:28 -04:00
Updated code based on comments
This commit is contained in:
@@ -87,7 +87,9 @@ class Config(object):
|
||||
"tts-benefits-studio@gsa.gov",
|
||||
],
|
||||
}
|
||||
FEATURE_BEST_PRACTICES_ENABLED = getenv("FEATURE_BEST_PRACTICES_ENABLED", "false")
|
||||
FEATURE_BEST_PRACTICES_ENABLED = (
|
||||
getenv("FEATURE_BEST_PRACTICES_ENABLED", "false") == "true"
|
||||
)
|
||||
|
||||
|
||||
def _s3_credentials_from_env(bucket_prefix):
|
||||
|
||||
@@ -17,17 +17,15 @@ 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
|
||||
|
||||
feature_best_practices_enabled = (
|
||||
os.getenv("FEATURE_BEST_PRACTICES_ENABLED", "false").lower() == "true"
|
||||
)
|
||||
|
||||
|
||||
# Hook to check for guidance routes
|
||||
@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"])
|
||||
if (
|
||||
request.path.startswith("/best-practices")
|
||||
and not feature_best_practices_enabled
|
||||
and not current_app.config["FEATURE_BEST_PRACTICES_ENABLED"]
|
||||
):
|
||||
abort(404)
|
||||
|
||||
@@ -276,7 +274,9 @@ def guidance_index():
|
||||
return render_template(
|
||||
"views/guidance/index.html",
|
||||
navigation_links=using_notify_nav(),
|
||||
feature_best_practices_enabled=feature_best_practices_enabled
|
||||
feature_best_practices_enabled=current_app.config[
|
||||
"FEATURE_BEST_PRACTICES_ENABLED"
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user