[fix] Corrections ruff CI (UP017/UP041/UP012/I001/F401/FURB162) : backend/tools/audit.py
This commit is contained in:
@@ -7,7 +7,7 @@ Reuses the application audit log (``data/audit.log``, JSON lines) and adds an
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from datetime import datetime, timezone
|
from datetime import UTC, datetime
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from backend.audit import _write_entry
|
from backend.audit import _write_entry
|
||||||
@@ -41,7 +41,7 @@ def log_tool_call(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Append an ``ai_tool_call`` entry to the audit log."""
|
"""Append an ``ai_tool_call`` entry to the audit log."""
|
||||||
_write_entry({
|
_write_entry({
|
||||||
"timestamp": datetime.now(timezone.utc).isoformat(),
|
"timestamp": datetime.now(UTC).isoformat(),
|
||||||
"action": "ai_tool_call",
|
"action": "ai_tool_call",
|
||||||
"username": username,
|
"username": username,
|
||||||
"ip": ip or "unknown",
|
"ip": ip or "unknown",
|
||||||
|
|||||||
Reference in New Issue
Block a user