Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add type

Mira Szewczyk0fe33b50fcb2
diff --git a/saleor/graphql/stock/mutations.py b/saleor/graphql/stock/mutations.py
index 9710d7303e..bd5d78cc08 100644
--- a/saleor/graphql/stock/mutations.py
+++ b/saleor/graphql/stock/mutations.py
@@ -37,7 +37,7 @@ class StockUpdate(ModelMutation):
class StockDelete(ModelDeleteMutation):
class Arguments:
- id = graphene.ID(required=True, description="ID fo stock to delete.")
+ id = graphene.ID(required=True, description="ID of stock to delete.")
class Meta:
model = models.Stock
diff --git a/saleor/graphql/stock/types.py b/saleor/graphql/stock/types.py
index 25cee11e89..5071c327ce 100644
--- a/saleor/graphql/stock/types.py
+++ b/saleor/graphql/stock/types.py
@@ -14,7 +14,7 @@ class StockInput(graphene.InputObjectType):
required=True, description="Warehouse in which stock is lockated."
)
quantity = graphene.Int(description="Quantity of items available for sell.")
- quantity_allocated = graphene.Int()
+ quantity_allocated = graphene.Int(description="Quantity allocated for orders.")
class Stock(CountableDjangoObjectType):
diff --git a/saleor/order/utils.py b/saleor/order/utils.py
index 73ab2ccc89..0bfa45f987 100644
--- a/saleor/order/utils.py
+++ b/saleor/order/utils.py
@@ -20,7 +20,8 @@ from ..stock.management import allocate_stock, deallocate_stock, increase_stock
from . import events
-def get_order_country(order) -> str:
+def get_order_country(order: Order) -> str:
+ """Return country to which order will be shipped."""
address = order.billing_address
if order.is_shipping_required():
address = order.shipping_address
diff --git a/saleor/warehouse/validation.py b/saleor/warehouse/validation.py
index d26d856ed0..ec87c2266e 100644
--- a/saleor/warehouse/validation.py
+++ b/saleor/warehouse/validation.py
@@ -1,7 +1,8 @@
from ..shipping.models import ShippingZone
+from .models import Warehouse
-def validate_warehouse_count(shipping_zones, instance) -> bool:
+def validate_warehouse_count(shipping_zones, instance: Warehouse) -> bool:
"""Every ShippingZone can be assigned to only one warehouse.
If not there would be issue with automatically selecting stock for operation.