From 7aaf428de3095f2261e67721dfb7bc07d71a9df3 Mon Sep 17 00:00:00 2001 From: Hanne Moa Date: Tue, 26 Sep 2023 09:50:36 +0200 Subject: [PATCH] Annotate incident_fits_tristates --- src/argus/notificationprofile/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/argus/notificationprofile/models.py b/src/argus/notificationprofile/models.py index 5aca2e498..b787635ff 100644 --- a/src/argus/notificationprofile/models.py +++ b/src/argus/notificationprofile/models.py @@ -4,7 +4,7 @@ from functools import reduce import logging from operator import or_ -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Dict, Optional from django.conf import settings from django.db import models @@ -20,6 +20,8 @@ if TYPE_CHECKING: from argus.incident.models import Event, Incident +TriState = Optional[bool] + LOG = logging.getLogger(__name__) @@ -140,7 +142,7 @@ def is_empty(self): and self.is_event_type_empty() ) - def incident_fits_tristates(self, incident): + def incident_fits_tristates(self, incident) -> Dict[str, TriState]: if self.are_tristates_empty(): return {} fits_tristates = {}