Enable real database deletion of products
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 21s

This commit is contained in:
vickytechkey 2026-08-16 11:03:10 +05:30
parent b826cc2feb
commit 49d470c2b0

View file

@ -57,7 +57,8 @@ def delete_product(request, pk):
return Response({"detail": "Product not found"}, status=404)
name = product.name
# Database table is read-only for CRM (managed=False).
# We bypass delete and log the action successfully.
# Run the delete on the database
product.delete()
log_product_action(request.user, 'delete_product', pk, {"title": name})
return Response({"message": f"Product '{name}' permanently deleted"})