mirror of
https://github.com/ae-utbm/sith.git
synced 2025-10-09 08:14:39 +00:00
feat: automatic product archiving
This commit is contained in:
12
counter/tasks.py
Normal file
12
counter/tasks.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# Create your tasks here
|
||||
|
||||
from celery import shared_task
|
||||
|
||||
from counter.models import Product
|
||||
|
||||
|
||||
@shared_task
|
||||
def archive_product(product_id: int):
|
||||
product = Product.objects.get(id=product_id)
|
||||
product.archived = True
|
||||
product.save()
|
Reference in New Issue
Block a user