(self, queued_sms)
return True
Returns False if the outbound daily limit has been exceeded.
Returns False if the outbound daily limit has been exceeded.
Returns False if the outbound daily limit has been exceeded .
def can_send_outbound_sms(self, queued_sms):
        """
        Returns False if the outbound daily limit has been exceeded.
        """
        value = self.increment()

        if value > self.daily_limit:
            # Delay processing by an hour so that in case the
            # limit gets increased within the same day, we start
            # processing the backlog right away.
            self.decrement()
            delay_processing(queued_sms, 60)
            domain = self.domain_object.name if self.domain_object else ''
            # Log the fact that we reached this limit and send alert on first breach
            # via Django Signals if needed
            DailyOutboundSMSLimitReached.create_for_domain_and_date(
                domain,
                self.date
            )
            return False

        return True
def can_send_outbound_sms ( self , queued_sms ) : value = self . increment ( ) if value > self . daily_limit : # Delay processing by an hour so that in case the # limit gets increased within the same day, we start # processing the backlog right away. self . decrement ( ) delay_processing ( queued_sms , 60 ) domain = self . domain_object . name if self . domain_object else '' # Log the fact that we reached this limit and send alert on first breach # via Django Signals if needed DailyOutboundSMSLimitReached . create_for_domain_and_date ( domain , self . date ) return False return True