Skip to content

Commit

Permalink
Annotate incident_fits_tristates
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Sep 26, 2023
1 parent 178b102 commit 6e69781
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/argus/notificationprofile/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,6 +20,8 @@
if TYPE_CHECKING:
from argus.incident.models import Event, Incident

TriState = Optional[bool]


LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -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 = {}
Expand Down

0 comments on commit 6e69781

Please sign in to comment.