Пример #1
0
    def do_accounting(self, canarydrop=None):
        try:
            alert_count = int(
                lookup_canarytoken_alert_count(canarydrop.canarytoken)) + 1
        except TypeError:
            alert_count = 1

        save_canarytoken_alert_count(canarydrop.canarytoken, alert_count,
                                     self.alert_expiry)
Пример #2
0
    def do_accounting(self, canarydrop=None):
        try:
            alert_count = int(lookup_canarytoken_alert_count(
                                    canarydrop.canarytoken))+1
        except TypeError:
            alert_count = 1

        save_canarytoken_alert_count(canarydrop.canarytoken, alert_count,
                                    self.alert_expiry)
Пример #3
0
    def can_send_alert(self, canarydrop=None):
        try:
            alert_count = int(
                lookup_canarytoken_alert_count(canarydrop.canarytoken))
        except TypeError:
            return True

        if alert_count + 1 <= self.alert_limit:
            return True

        return False
Пример #4
0
    def can_send_alert(self, canarydrop=None):
        try:
            alert_count = int(lookup_canarytoken_alert_count(
                                    canarydrop.canarytoken))
        except TypeError:
            return True

        if alert_count + 1 <= self.alert_limit:
            return True

        return False