Files
Sith/counter/tasks.py
2025-09-14 01:36:46 +02:00

14 lines
266 B
Python

# Create your tasks here
from celery import shared_task
from counter.models import Product
@shared_task
def archive_product(product_id):
product = Product.objects.get(id=product_id)
product.archived = True
product.save()
product.counters.clear()