def send_alerts():
 products = Product.objects.filter(productalert__status=ProductAlert.ACTIVE).distinct()
 logger.info('Found %d products with active alerts', products.count())
 for product in products:
  send_product_alerts(product)

def send_alerts ( ) : products = Product . objects . filter ( productalert__status = ProductAlert . ACTIVE ) . distinct ( ) logger . info ( 'Found %d products with active alerts' , products . count ( ) ) for product in products : send_product_alerts ( product )
send out product alerts .