From ae9cd00cce1b871402f0f338fda3aea4ea556d5f Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 9 Nov 2026 20:42:15 +0100 Subject: [PATCH] Added timestamp option --- pyproject.toml | 2 +- send_notifications/send_notification.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3d24a88..dd8bfca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lib-send-notifications" -version = "0.1.0" +version = "0.1.1" description = "Shared library to send notifications via the internal backend API" requires-python = ">=3.10" authors = [{ name = "Florian Gänsejunge" }] diff --git a/send_notifications/send_notification.py b/send_notifications/send_notification.py index 2821de4..37168fd 100644 --- a/send_notifications/send_notification.py +++ b/send_notifications/send_notification.py @@ -82,6 +82,7 @@ class NotificationClient: body: str, link: str | None = None, category: str = "utility", + timestamp: int | None = None, *, user_id: int = 1, max_attempts: int = 5, @@ -125,7 +126,7 @@ class NotificationClient: "body": body, "link": link, "category": category, - "timestamp": int(time.time()), + "timestamp": timestamp if timestamp is not None else int(time.time()), }, }