Fix: Always return a list for audit log check (#4463)

This commit is contained in:
shamoon 2023-10-30 15:47:59 -07:00 committed by GitHub
parent 0f1dea67b7
commit 89757609c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,13 +203,16 @@ def settings_values_check(app_configs, **kwargs):
def audit_log_check(app_configs, **kwargs): def audit_log_check(app_configs, **kwargs):
db_conn = connections["default"] db_conn = connections["default"]
all_tables = db_conn.introspection.table_names() 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):
return [ result.append(
Critical( Critical(
( (
"auditlog table was found but PAPERLESS_AUDIT_LOG_ENABLED" "auditlog table was found but PAPERLESS_AUDIT_LOG_ENABLED"
" is not active. This setting cannot be disabled after enabling" " is not active. This setting cannot be disabled after enabling"
), ),
), ),
] )
return result