diff --git a/core/graphene/schema.py b/core/graphene/schema.py index 39db3442..f8c8d920 100644 --- a/core/graphene/schema.py +++ b/core/graphene/schema.py @@ -136,7 +136,7 @@ class Query(ObjectType): Product.objects.all().select_related("brand", "category").prefetch_related("images", "stocks") if info.context.user.has_perm("core.view_product") else Product.objects.filter( - is_active=True, brand__is_active=True, category__is_active=True + is_active=True, brand__is_active=True, category__is_active=True, stocks__isnull=False ).select_related("brand", "category").prefetch_related("images", "stocks") ) diff --git a/core/permissions.py b/core/permissions.py index 8ccdee87..258d87b0 100644 --- a/core/permissions.py +++ b/core/permissions.py @@ -51,6 +51,7 @@ class EvibesPermission(permissions.BasePermission): if action in [ "buy", + "buy_unregistered", "current", "add_order_product", "remove_order_product",