mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
* Disable logging remote IP address * Update auditlog/middleware.py * Update CHANGELOG.md * Update auditlog/middleware.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update auditlog/middleware.py and add tests in ManyRelatedModelTest * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
from django.conf import settings
|
|
|
|
# Register all models when set to True
|
|
settings.AUDITLOG_INCLUDE_ALL_MODELS = getattr(
|
|
settings, "AUDITLOG_INCLUDE_ALL_MODELS", False
|
|
)
|
|
|
|
# Exclude models in registration process
|
|
# It will be considered when `AUDITLOG_INCLUDE_ALL_MODELS` is True
|
|
settings.AUDITLOG_EXCLUDE_TRACKING_MODELS = getattr(
|
|
settings, "AUDITLOG_EXCLUDE_TRACKING_MODELS", ()
|
|
)
|
|
|
|
# Register models and define their logging behaviour
|
|
settings.AUDITLOG_INCLUDE_TRACKING_MODELS = getattr(
|
|
settings, "AUDITLOG_INCLUDE_TRACKING_MODELS", ()
|
|
)
|
|
|
|
# Exclude named fields across all models
|
|
settings.AUDITLOG_EXCLUDE_TRACKING_FIELDS = getattr(
|
|
settings, "AUDITLOG_EXCLUDE_TRACKING_FIELDS", ()
|
|
)
|
|
|
|
# Disable on raw save to avoid logging imports and similar
|
|
settings.AUDITLOG_DISABLE_ON_RAW_SAVE = getattr(
|
|
settings, "AUDITLOG_DISABLE_ON_RAW_SAVE", False
|
|
)
|
|
|
|
# CID
|
|
|
|
settings.AUDITLOG_CID_HEADER = getattr(
|
|
settings, "AUDITLOG_CID_HEADER", "x-correlation-id"
|
|
)
|
|
settings.AUDITLOG_CID_GETTER = getattr(settings, "AUDITLOG_CID_GETTER", None)
|
|
|
|
# migration
|
|
settings.AUDITLOG_TWO_STEP_MIGRATION = getattr(
|
|
settings, "AUDITLOG_TWO_STEP_MIGRATION", False
|
|
)
|
|
settings.AUDITLOG_USE_TEXT_CHANGES_IF_JSON_IS_NOT_PRESENT = getattr(
|
|
settings, "AUDITLOG_USE_TEXT_CHANGES_IF_JSON_IS_NOT_PRESENT", False
|
|
)
|
|
|
|
# Disable remote_addr field in database
|
|
settings.AUDITLOG_DISABLE_REMOTE_ADDR = getattr(
|
|
settings, "AUDITLOG_DISABLE_REMOTE_ADDR", False
|
|
)
|