mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-16 00:36:22 +00:00
Feature: Audit Trail (#4425)
Adds new feature for optionally enabling change tracking for possible audit purposes --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> Co-authored-by: Trenton Holmes <797416+stumpylog@users.noreply.github.com>
This commit is contained in:
@@ -5,9 +5,11 @@ import shutil
|
||||
import stat
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.checks import Critical
|
||||
from django.core.checks import Error
|
||||
from django.core.checks import Warning
|
||||
from django.core.checks import register
|
||||
from django.db import connections
|
||||
|
||||
exists_message = "{} is set but doesn't exist."
|
||||
exists_hint = "Create a directory at {}"
|
||||
@@ -195,3 +197,19 @@ def settings_values_check(app_configs, **kwargs):
|
||||
+ _barcode_scanner_validate()
|
||||
+ _email_certificate_validate()
|
||||
)
|
||||
|
||||
|
||||
@register()
|
||||
def audit_log_check(app_configs, **kwargs):
|
||||
db_conn = connections["default"]
|
||||
all_tables = db_conn.introspection.table_names()
|
||||
|
||||
if ("auditlog_logentry" in all_tables) and not (settings.AUDIT_LOG_ENABLED):
|
||||
return [
|
||||
Critical(
|
||||
(
|
||||
"auditlog table was found but PAPERLESS_AUDIT_LOG_ENABLED"
|
||||
" is not active. This setting cannot be disabled after enabling"
|
||||
),
|
||||
),
|
||||
]
|
||||
|
Reference in New Issue
Block a user