Enable real database deletion of products
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 21s
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 21s
This commit is contained in:
parent
b826cc2feb
commit
49d470c2b0
1 changed files with 3 additions and 2 deletions
|
|
@ -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"})
|
||||
|
|
|
|||
Loading…
Reference in a new issue