mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 00:20:43 -04:00
added feature flag
This commit is contained in:
@@ -25,15 +25,17 @@ from app.utils.user import user_is_logged_in
|
||||
def check_feature_flags():
|
||||
# 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)
|
||||
if request.path.startswith("/jobs") and not current_app.config.get(
|
||||
"FEATURE_SOCKET_ENABLED", False
|
||||
):
|
||||
abort(404)
|
||||
pass
|
||||
|
||||
|
||||
@main.route("/test/feature-flags")
|
||||
def test_feature_flags():
|
||||
return jsonify(
|
||||
{"FEATURE_ABOUT_PAGE_ENABLED": current_app.config["FEATURE_ABOUT_PAGE_ENABLED"]}
|
||||
{"FEATURE_SOCKET_ENABLED": current_app.config["FEATURE_SOCKET_ENABLED"]}
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ from functools import partial
|
||||
|
||||
from flask import (
|
||||
Response,
|
||||
current_app,
|
||||
abort,
|
||||
jsonify,
|
||||
redirect,
|
||||
@@ -59,6 +60,7 @@ def view_job(service_id, job_id):
|
||||
filter_args["status"] = set_status_filters(filter_args)
|
||||
return render_template(
|
||||
"views/jobs/job.html",
|
||||
FEATURE_SOCKET_ENABLED=current_app.config["FEATURE_SOCKET_ENABLED"],
|
||||
job=job,
|
||||
status=request.args.get("status", ""),
|
||||
updates_url=url_for(
|
||||
|
||||
Reference in New Issue
Block a user