From bdfae436ac334d25d37405ac4dac3805e575be7d Mon Sep 17 00:00:00 2001 From: "ahmed.mujtaba" Date: Wed, 9 Sep 2026 21:02:17 +0500 Subject: [PATCH] ats score ignired --- backend/notifications/models.py | 5 ++++- backend/notifications/views.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/notifications/models.py b/backend/notifications/models.py index f5a7edb..ed0d8f4 100644 --- a/backend/notifications/models.py +++ b/backend/notifications/models.py @@ -148,7 +148,9 @@ class Notifications(SQLModel, table=True): skip: int = 0, ): statement = select(cls).where( - cls.user_id == user_id, cls.is_deleted == False # noqa: E712 + cls.user_id == user_id, + cls.is_deleted == False, # noqa: E712 + cls.title != "ATS score ready", ) if unread_only: statement = statement.where(cls.is_read == False) # noqa: E712 @@ -158,6 +160,7 @@ class Notifications(SQLModel, table=True): cls.user_id == user_id, cls.is_deleted == False, # noqa: E712 cls.is_read == False, # noqa: E712 + cls.title != "ATS score ready", ) unread = (await session.execute(unread_statement)).scalar_one() statement = statement.order_by(cls.created_at.desc()) diff --git a/backend/notifications/views.py b/backend/notifications/views.py index 58934b5..472e373 100644 --- a/backend/notifications/views.py +++ b/backend/notifications/views.py @@ -29,7 +29,7 @@ from users.models import Users logger = logging.getLogger(__name__) -# Candidate-history event_type → in-app kind, title, and profile tab. +_SILENT_HISTORY_EVENTS = frozenset({"ats.scored"}) _HISTORY_KIND = { "stage.changed": "application", "candidate.created": "application", @@ -432,6 +432,8 @@ async def notify_candidate_history( """One in-app row per job stakeholder for a candidate_history write.""" if row is None: return [] + if row.event_type in _SILENT_HISTORY_EVENTS: + return [] try: from job.job_post.models import JobPosts