From fef211b2d0b4cf46b4f6ae85bd132e7849b532fc Mon Sep 17 00:00:00 2001 From: moanos Date: Wed, 1 Jan 2025 14:34:38 +0100 Subject: [PATCH] feat: Add logging --- src/fellchensammlung/tools/search.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fellchensammlung/tools/search.py b/src/fellchensammlung/tools/search.py index a188273..67c2115 100644 --- a/src/fellchensammlung/tools/search.py +++ b/src/fellchensammlung/tools/search.py @@ -12,6 +12,7 @@ def notify_search_subscribers(adoption_notice: AdoptionNotice, only_if_active : If the new adoption notice fits the search subscription, it sends a notification to the user that created the search. """ if only_if_active and not adoption_notice.is_active: + logging.warning(f"No notifications triggered for adoption notice {adoption_notice} because it's not active.") return for search_subscription in SearchSubscription.objects.all(): search = Search(search_subscription=search_subscription) @@ -22,6 +23,8 @@ def notify_search_subscribers(adoption_notice: AdoptionNotice, only_if_active : adoption_notice=adoption_notice, text=notification_text) + logging.info(f"Subscribers for AN {adoption_notice.pk} have been notified") + class Search: def __init__(self, request=None, search_subscription=None):