Fix audit logging call for orphaned jobs deletion

Added missing 'message' parameter to _log_admin_event call and
converted details dict to JSON string to match the function signature.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Ivo Oskamp 2026-02-09 14:31:34 +01:00
parent 710aba97e4
commit 08437aff7f

View File

@ -282,11 +282,12 @@ def settings_jobs_delete_orphaned():
_log_admin_event( _log_admin_event(
event_type="maintenance_delete_orphaned_jobs", event_type="maintenance_delete_orphaned_jobs",
details={ message=f"Deleted {job_count} orphaned jobs, {run_count} runs, and {mail_count} emails",
details=json.dumps({
"jobs_deleted": job_count, "jobs_deleted": job_count,
"runs_deleted": run_count, "runs_deleted": run_count,
"mails_deleted": mail_count, "mails_deleted": mail_count,
}, }),
) )
except Exception as exc: except Exception as exc: