fix availability alert filter to get overdue alerts working

This commit is contained in:
sadnub
2022-04-20 08:51:17 -04:00
parent 46c7e89a94
commit b94c3961eb

View File

@@ -110,7 +110,9 @@ class Alert(models.Model):
def create_or_return_availability_alert( def create_or_return_availability_alert(
cls, agent: Agent, skip_create: bool = False cls, agent: Agent, skip_create: bool = False
) -> Optional[Alert]: ) -> Optional[Alert]:
if not cls.objects.filter(agent=agent, resolved=False).exists(): if not cls.objects.filter(
agent=agent, alert_type="availability", resolved=False
).exists():
if skip_create: if skip_create:
return None return None