Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

oscar_send_alerts.py 713B

12345678910111213141516171819202122232425
  1. import logging
  2. from django.utils.translation import ugettext_lazy as _
  3. from django.core.management.base import BaseCommand
  4. from oscar.apps.customer.alerts import utils
  5. logger = logging.getLogger(__name__)
  6. class Command(BaseCommand):
  7. """
  8. Check stock records of products for availability and send out alerts
  9. to customers that have registered for an alert.
  10. """
  11. help = _("Check check for products that are back in "
  12. "stock and send out alerts")
  13. def handle(self, **options):
  14. """
  15. Check all products with active product alerts for
  16. availability and send out email alerts when a product is
  17. available to buy.
  18. """
  19. utils.send_alerts()