old_console/dashboard/widgets/opened_incs_widget.py
2024-11-02 14:12:45 +03:00

10 lines
242 B
Python

import logging
from incident.models import Incident
from networkmap.api import DANGER_STATUSES
_log = logging.getLogger()
def get_opened_incidents_count():
return Incident.objects.filter(status__in=DANGER_STATUSES).distinct().count()