Skip to content

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

Change order of parameters in get_products_data

IKarbowiak9195c8610e19
diff --git a/saleor/csv/utils/export.py b/saleor/csv/utils/export.py
index 60206c4e47..da10168898 100644
--- a/saleor/csv/utils/export.py
+++ b/saleor/csv/utils/export.py
@@ -145,7 +145,7 @@ def export_products_in_batches(
)
export_data = get_products_data(
- product_batch, export_fields, warehouses, attributes,
+ product_batch, export_fields, attributes, warehouses
)
append_to_file(export_data, headers, export_file, file_type, delimiter)
diff --git a/saleor/csv/utils/products_data.py b/saleor/csv/utils/products_data.py
index a53d8d729e..6a1cfcf6e0 100644
--- a/saleor/csv/utils/products_data.py
+++ b/saleor/csv/utils/products_data.py
@@ -163,8 +163,8 @@ def get_warehouses_headers(export_info: Dict[str, list]):
def get_products_data(
queryset: "QuerySet",
export_fields: Set[str],
- warehouse_ids: Optional[List[int]],
attribute_ids: Optional[List[int]],
+ warehouse_ids: Optional[List[int]],
) -> List[Dict[str, Union[str, bool]]]:
"""Create data list of products and their variants with fields values.
diff --git a/tests/test_csv_products_data.py b/tests/test_csv_products_data.py
index 4147695dbf..17e55623d5 100644
--- a/tests/test_csv_products_data.py
+++ b/tests/test_csv_products_data.py
@@ -65,7 +65,7 @@ def test_get_products_data(product, product_with_image, collection, image):
# when
result_data = get_products_data(
- products, export_fields, warehouse_ids, attribute_ids
+ products, export_fields, attribute_ids, warehouse_ids
)
# then
@@ -142,7 +142,7 @@ def test_get_products_data_for_specified_attributes(
attribute_ids = [str(attr.pk) for attr in Attribute.objects.all()][:1]
# when
- result_data = get_products_data(products, export_fields, [], attribute_ids)
+ result_data = get_products_data(products, export_fields, attribute_ids, [])
# then
expected_data = []
@@ -183,7 +183,7 @@ def test_get_products_data_for_specified_warehouses(
# when
result_data = get_products_data(
- products, export_fields, warehouse_ids, attribute_ids
+ products, export_fields, attribute_ids, warehouse_ids
)
# then
@@ -227,7 +227,7 @@ def test_get_products_data_for_specified_warehouses_and_attributes(
# when
result_data = get_products_data(
- products, export_fields, warehouse_ids, attribute_ids
+ products, export_fields, attribute_ids, warehouse_ids
)
# then