Rename audit log feature flag config variable
This commit is contained in:
parent
c27e0e618e
commit
9de90d796d
@ -150,9 +150,7 @@ def set_default_headers(app): # pragma: no cover
|
||||
def map_config(config):
|
||||
return {
|
||||
**config["default"],
|
||||
"AUDIT_LOG_FEATURE_TOGGLE": config["default"].getboolean(
|
||||
"AUDIT_LOG_FEATURE_TOGGLE"
|
||||
),
|
||||
"USE_AUDIT_LOG": config["default"].getboolean("USE_AUDIT_LOG"),
|
||||
"ENV": config["default"]["ENVIRONMENT"],
|
||||
"BROKER_URL": config["default"]["REDIS_URI"],
|
||||
"DEBUG": config["default"].getboolean("DEBUG"),
|
||||
|
@ -37,7 +37,7 @@ class AuditableMixin(object):
|
||||
},
|
||||
)
|
||||
|
||||
if app.config.get("AUDIT_LOG_FEATURE_TOGGLE", False):
|
||||
if app.config.get("USE_AUDIT_LOG", False):
|
||||
audit_event = AuditEvent(**log_data)
|
||||
audit_event.save(connection)
|
||||
|
||||
|
@ -24,7 +24,7 @@ bp.context_processor(atat_context_processor)
|
||||
@bp.route("/activity-history")
|
||||
@user_can(Permissions.VIEW_AUDIT_LOG, message="view activity log")
|
||||
def activity_history():
|
||||
if app.config.get("AUDIT_LOG_FEATURE_TOGGLE", False):
|
||||
if app.config.get("USE_AUDIT_LOG", False):
|
||||
pagination_opts = Paginator.get_pagination_opts(request)
|
||||
audit_events = AuditLog.get_all_events(pagination_opts)
|
||||
return render_template("audit_log/audit_log.html", audit_events=audit_events)
|
||||
|
@ -1,5 +1,5 @@
|
||||
[default]
|
||||
AUDIT_LOG_FEATURE_TOGGLE = false
|
||||
USE_AUDIT_LOG = false
|
||||
CAC_URL = http://localhost:8000/login-redirect
|
||||
CA_CHAIN = ssl/server-certs/ca-chain.pem
|
||||
CLASSIFIED = false
|
||||
|
@ -117,7 +117,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
{% if user_can(permissions.VIEW_APPLICATION_ACTIVITY_LOG) and config.get("AUDIT_LOG_FEATURE_TOGGLE", False) %}
|
||||
{% if user_can(permissions.VIEW_APPLICATION_ACTIVITY_LOG) and config.get("USE_AUDIT_LOG", False) %}
|
||||
{% include "fragments/audit_events_log.html" %}
|
||||
{{ Pagination(audit_events, url=url_for('applications.settings', application_id=application.id)) }}
|
||||
{% endif %}
|
||||
|
@ -64,7 +64,7 @@
|
||||
{% include "portfolios/fragments/portfolio_members.html" %}
|
||||
{% endif %}
|
||||
|
||||
{% if user_can(permissions.VIEW_PORTFOLIO_ACTIVITY_LOG) and config.get("AUDIT_LOG_FEATURE_TOGGLE", False) %}
|
||||
{% if user_can(permissions.VIEW_PORTFOLIO_ACTIVITY_LOG) and config.get("USE_AUDIT_LOG", False) %}
|
||||
{% include "fragments/audit_events_log.html" %}
|
||||
{{ Pagination(audit_events, url_for('portfolios.admin', portfolio_id=portfolio.id)) }}
|
||||
{% endif %}
|
||||
|
@ -42,11 +42,11 @@ def app(request):
|
||||
def skip_audit_log(request):
|
||||
"""
|
||||
Conditionally skip tests marked with 'audit_log' based on the
|
||||
AUDIT_LOG_FEATURE_TOGGLE config value.
|
||||
USE_AUDIT_LOG config value.
|
||||
"""
|
||||
config = make_config()
|
||||
if request.node.get_closest_marker("audit_log"):
|
||||
use_audit_log = config.get("AUDIT_LOG_FEATURE_TOGGLE", False)
|
||||
use_audit_log = config.get("USE_AUDIT_LOG", False)
|
||||
if not use_audit_log:
|
||||
pytest.skip("audit log feature flag disabled")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user