[fix] Version 2.80.1 synchronisee + corrections ruff (60 erreurs CI) #26

Merged
bruno merged 31 commits from fix/version-2.80.1-ruff into main 2026-10-27 23:00:14 -04:00
Showing only changes of commit 632871ac24 - Show all commits
+4 -4
View File
@@ -25,7 +25,7 @@ import os
import smtplib import smtplib
import threading import threading
import uuid import uuid
from datetime import datetime, timezone from datetime import UTC, datetime
from email.message import EmailMessage from email.message import EmailMessage
from pathlib import Path from pathlib import Path
from typing import Any from typing import Any
@@ -182,7 +182,7 @@ def create_channel(name: str, channel_type: str, config: dict[str, Any]) -> dict
"type": channel_type, "type": channel_type,
"enabled": True, "enabled": True,
"config": normalized, "config": normalized,
"created_at": datetime.now(timezone.utc).isoformat(), "created_at": datetime.now(UTC).isoformat(),
"last_sent_at": None, "last_sent_at": None,
"last_error": None, "last_error": None,
} }
@@ -287,7 +287,7 @@ def _send_webhook(url: str, title: str, message: str, trigger: str) -> None:
"event": trigger, "event": trigger,
"title": title, "title": title,
"message": message, "message": message,
"timestamp": datetime.now(timezone.utc).isoformat(), "timestamp": datetime.now(UTC).isoformat(),
"source": "obsigate-notify", "source": "obsigate-notify",
}, },
timeout=10.0, timeout=10.0,
@@ -345,6 +345,6 @@ def _mark_sent(channel_id: str, error: str | None) -> None:
channels = _read_channels() channels = _read_channels()
for channel in channels: for channel in channels:
if channel.get("id") == channel_id: if channel.get("id") == channel_id:
channel["last_sent_at"] = datetime.now(timezone.utc).isoformat() channel["last_sent_at"] = datetime.now(UTC).isoformat()
channel["last_error"] = error channel["last_error"] = error
_write_channels(channels) _write_channels(channels)