diff --git a/crm/__pycache__/serializers.cpython-312.pyc b/crm/__pycache__/serializers.cpython-312.pyc index 2e48314..dc2dbb4 100644 Binary files a/crm/__pycache__/serializers.cpython-312.pyc and b/crm/__pycache__/serializers.cpython-312.pyc differ diff --git a/crm/__pycache__/urls.cpython-312.pyc b/crm/__pycache__/urls.cpython-312.pyc index ff458e0..4c51709 100644 Binary files a/crm/__pycache__/urls.cpython-312.pyc and b/crm/__pycache__/urls.cpython-312.pyc differ diff --git a/crm/views/__pycache__/customer_views.cpython-312.pyc b/crm/views/__pycache__/customer_views.cpython-312.pyc index d6e0316..bfe48d6 100644 Binary files a/crm/views/__pycache__/customer_views.cpython-312.pyc and b/crm/views/__pycache__/customer_views.cpython-312.pyc differ diff --git a/crm/views/__pycache__/dashboard_views.cpython-312.pyc b/crm/views/__pycache__/dashboard_views.cpython-312.pyc index 33d6fe9..89aba4b 100644 Binary files a/crm/views/__pycache__/dashboard_views.cpython-312.pyc and b/crm/views/__pycache__/dashboard_views.cpython-312.pyc differ diff --git a/crm/views/__pycache__/product_views.cpython-312.pyc b/crm/views/__pycache__/product_views.cpython-312.pyc index 2979352..b68ccd3 100644 Binary files a/crm/views/__pycache__/product_views.cpython-312.pyc and b/crm/views/__pycache__/product_views.cpython-312.pyc differ diff --git a/crm/views/__pycache__/seller_views.cpython-312.pyc b/crm/views/__pycache__/seller_views.cpython-312.pyc index 0735c0e..afc490e 100644 Binary files a/crm/views/__pycache__/seller_views.cpython-312.pyc and b/crm/views/__pycache__/seller_views.cpython-312.pyc differ diff --git a/crm/views/product_views.py b/crm/views/product_views.py index 70500d4..f6079d8 100644 --- a/crm/views/product_views.py +++ b/crm/views/product_views.py @@ -30,8 +30,8 @@ def approve_product(request, pk): except Product.DoesNotExist: return Response({"detail": "Product not found"}, status=404) - # Database table does not have status/is_active columns (managed=False). - # We bypass save and log the action successfully. + product.status = 'approved' + product.save() log_product_action(request.user, 'approve_product', product.id, {"title": product.name}) return Response({"message": f"Product '{product.name}' approved successfully"}) @@ -43,8 +43,8 @@ def hold_product(request, pk): except Product.DoesNotExist: return Response({"detail": "Product not found"}, status=404) - # Database table does not have status/is_active columns (managed=False). - # We bypass save and log the action successfully. + product.status = 'hold' + product.save() log_product_action(request.user, 'hold_product', product.id, {"title": product.name}) return Response({"message": f"Product '{product.name}' placed on hold"}) diff --git a/customer_models/__pycache__/models.cpython-312.pyc b/customer_models/__pycache__/models.cpython-312.pyc index b35072c..29dcc4b 100644 Binary files a/customer_models/__pycache__/models.cpython-312.pyc and b/customer_models/__pycache__/models.cpython-312.pyc differ diff --git a/digihoxbackend/__pycache__/settings.cpython-312.pyc b/digihoxbackend/__pycache__/settings.cpython-312.pyc index f37d0b2..00fb632 100644 Binary files a/digihoxbackend/__pycache__/settings.cpython-312.pyc and b/digihoxbackend/__pycache__/settings.cpython-312.pyc differ diff --git a/seller_models/__pycache__/models.cpython-312.pyc b/seller_models/__pycache__/models.cpython-312.pyc index 16fd301..b8e9bd2 100644 Binary files a/seller_models/__pycache__/models.cpython-312.pyc and b/seller_models/__pycache__/models.cpython-312.pyc differ diff --git a/seller_models/models.py b/seller_models/models.py index 77f69ec..582a76f 100644 --- a/seller_models/models.py +++ b/seller_models/models.py @@ -41,13 +41,8 @@ class Product(models.Model): def name(self): return self.title - @property - def status(self): - return "approved" - - @property - def is_active(self): - return True + status = models.CharField(max_length=50, default='pending') + is_active = models.BooleanField(default=True) class Wallet(models.Model): supplier_id = models.IntegerField(unique=True)