From 632871ac248ce1adcabe84c0d757b4cf8ebbfd42 Mon Sep 17 00:00:00 2001 From: bruno Date: Tue, 27 Oct 2026 22:57:40 -0400 Subject: [PATCH] [fix] Corrections ruff CI (UP017/UP041/UP012/I001/F401/FURB162) : backend/notify.py --- backend/notify.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/notify.py b/backend/notify.py index dea7790..8da4e77 100644 --- a/backend/notify.py +++ b/backend/notify.py @@ -25,7 +25,7 @@ import os import smtplib import threading import uuid -from datetime import datetime, timezone +from datetime import UTC, datetime from email.message import EmailMessage from pathlib import Path from typing import Any @@ -182,7 +182,7 @@ def create_channel(name: str, channel_type: str, config: dict[str, Any]) -> dict "type": channel_type, "enabled": True, "config": normalized, - "created_at": datetime.now(timezone.utc).isoformat(), + "created_at": datetime.now(UTC).isoformat(), "last_sent_at": None, "last_error": None, } @@ -287,7 +287,7 @@ def _send_webhook(url: str, title: str, message: str, trigger: str) -> None: "event": trigger, "title": title, "message": message, - "timestamp": datetime.now(timezone.utc).isoformat(), + "timestamp": datetime.now(UTC).isoformat(), "source": "obsigate-notify", }, timeout=10.0, @@ -345,6 +345,6 @@ def _mark_sent(channel_id: str, error: str | None) -> None: channels = _read_channels() for channel in channels: 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 _write_channels(channels)