Переместил таск
This commit is contained in:
parent
a4a63bd31f
commit
657498da0d
@ -7,7 +7,7 @@ logger = logging.getLogger(__name__)
|
|||||||
@background(schedule=0)
|
@background(schedule=0)
|
||||||
def send_order_notification_background(order_id):
|
def send_order_notification_background(order_id):
|
||||||
"""Асинхронная отправка уведомлений о заказе через background-tasks."""
|
"""Асинхронная отправка уведомлений о заказе через background-tasks."""
|
||||||
from .email_notifications import send_order_notification
|
from .utils.email_notifications import send_order_notification
|
||||||
from products.models import Order
|
from products.models import Order
|
||||||
try:
|
try:
|
||||||
order = Order.objects.select_related('product', 'configuration').get(id=order_id)
|
order = Order.objects.select_related('product', 'configuration').get(id=order_id)
|
||||||
@ -23,7 +23,7 @@ def send_order_notification_background(order_id):
|
|||||||
@background(schedule=0)
|
@background(schedule=0)
|
||||||
def send_multiple_order_notifications_background(order_ids):
|
def send_multiple_order_notifications_background(order_ids):
|
||||||
"""Отправка уведомлений для нескольких заказов."""
|
"""Отправка уведомлений для нескольких заказов."""
|
||||||
from .email_notifications import send_multiple_order_notifications
|
from .utils.email_notifications import send_multiple_order_notifications
|
||||||
from products.models import Order
|
from products.models import Order
|
||||||
orders = Order.objects.filter(id__in=order_ids)
|
orders = Order.objects.filter(id__in=order_ids)
|
||||||
return send_multiple_order_notifications(orders)
|
return send_multiple_order_notifications(orders)
|
||||||
@ -36,7 +36,7 @@ except ImportError:
|
|||||||
if shared_task is not None:
|
if shared_task is not None:
|
||||||
@shared_task
|
@shared_task
|
||||||
def send_order_notification_celery(order_id):
|
def send_order_notification_celery(order_id):
|
||||||
from .email_notifications import send_order_notification
|
from .utils.email_notifications import send_order_notification
|
||||||
from products.models import Order
|
from products.models import Order
|
||||||
try:
|
try:
|
||||||
order = Order.objects.select_related('product', 'configuration').get(id=order_id)
|
order = Order.objects.select_related('product', 'configuration').get(id=order_id)
|
||||||
@ -50,7 +50,7 @@ if shared_task is not None:
|
|||||||
|
|
||||||
@shared_task
|
@shared_task
|
||||||
def send_multiple_order_notifications_celery(order_ids):
|
def send_multiple_order_notifications_celery(order_ids):
|
||||||
from .email_notifications import send_multiple_order_notifications
|
from .utils.email_notifications import send_multiple_order_notifications
|
||||||
from products.models import Order
|
from products.models import Order
|
||||||
orders = Order.objects.filter(id__in=order_ids)
|
orders = Order.objects.filter(id__in=order_ids)
|
||||||
return send_multiple_order_notifications(orders)
|
return send_multiple_order_notifications(orders)
|
||||||
Loading…
x
Reference in New Issue
Block a user