mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Change: enable auditlog by default, fix import / export (#6267)
This commit is contained in:
@@ -5,7 +5,6 @@ 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
|
||||
@@ -205,13 +204,10 @@ def audit_log_check(app_configs, **kwargs):
|
||||
all_tables = db_conn.introspection.table_names()
|
||||
result = []
|
||||
|
||||
if ("auditlog_logentry" in all_tables) and not (settings.AUDIT_LOG_ENABLED):
|
||||
if ("auditlog_logentry" in all_tables) and not settings.AUDIT_LOG_ENABLED:
|
||||
result.append(
|
||||
Critical(
|
||||
(
|
||||
"auditlog table was found but PAPERLESS_AUDIT_LOG_ENABLED"
|
||||
" is not active. This setting cannot be disabled after enabling"
|
||||
),
|
||||
Warning(
|
||||
("auditlog table was found but audit log is disabled."),
|
||||
),
|
||||
)
|
||||
|
||||
|
@@ -1045,7 +1045,7 @@ TIKA_GOTENBERG_ENDPOINT = os.getenv(
|
||||
if TIKA_ENABLED:
|
||||
INSTALLED_APPS.append("paperless_tika.apps.PaperlessTikaConfig")
|
||||
|
||||
AUDIT_LOG_ENABLED = __get_boolean("PAPERLESS_AUDIT_LOG_ENABLED", "NO")
|
||||
AUDIT_LOG_ENABLED = __get_boolean("PAPERLESS_AUDIT_LOG_ENABLED", "true")
|
||||
if AUDIT_LOG_ENABLED:
|
||||
INSTALLED_APPS.append("auditlog")
|
||||
MIDDLEWARE.append("auditlog.middleware.AuditlogMiddleware")
|
||||
|
@@ -259,9 +259,6 @@ class TestAuditLogChecks(TestCase):
|
||||
msg = msgs[0]
|
||||
|
||||
self.assertIn(
|
||||
(
|
||||
"auditlog table was found but PAPERLESS_AUDIT_LOG_ENABLED"
|
||||
" is not active."
|
||||
),
|
||||
("auditlog table was found but audit log is disabled."),
|
||||
msg.msg,
|
||||
)
|
||||
|
Reference in New Issue
Block a user