def alert(self):
        if not self.alerts_enabled:
            return
        if self.overall_status != self.PASSING_STATUS:
            # Don't alert every time
            if self.overall_status == self.WARNING_STATUS:
                if self.last_alert_sent and self.last_alert_sent < (timezone.now() - timedelta(minutes=settings.NOTIFICATION_INTERVAL)):
                    return
            elif self.overall_status in (self.CRITICAL_STATUS, self.ERROR_STATUS):
                if self.last_alert_sent and (timezone.now() - timedelta(minutes=settings.ALERT_INTERVAL)) < self.last_alert_sent:
                    return
            self.last_alert_sent = timezone.now()
        else:
            # We don't count "back to normal" as an alert
            self.last_alert_sent = None
        self.save()
        if self.unexpired_acknowledgement():
            send_alert_update(self, duty_officers=get_duty_officers())
        else:
            self.snapshot.did_send_alert = True
            self.snapshot.save()
            send_alert(self, duty_officers=get_duty_officers())
dataset/ETHPy150Open arachnys/cabot/cabot/cabotapp/models.py/CheckGroupMixin.alert/swapped operands of `<`