Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add slug to ProductType and Warehouse in popopulatedb
IKarbowiakf015ebb94089
diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.pyindex e64679d875..d86b6703f0 100644--- a/saleor/core/utils/random_data.py+++ b/saleor/core/utils/random_data.py@@ -14,10 +14,13 @@ from django.contrib.sites.models import Sitefrom django.core.files import Filefrom django.db.models import Qfrom django.utils import timezone+from django.utils.encoding import smart_text+from django.utils.text import slugifyfrom faker import Factoryfrom faker.providers import BaseProviderfrom measurement.measures import Weightfrom prices import Money, TaxedMoney+from text_unidecode import unidecodefrom ...account.models import Address, Userfrom ...account.utils import store_user_address@@ -937,8 +940,10 @@ def create_shipping_zones():def create_warehouses():for shipping_zone in ShippingZone.objects.all():+ shipping_zone_name = shipping_zone.namewarehouse, _ = Warehouse.objects.update_or_create(- name=shipping_zone.name,+ name=shipping_zone_name,+ slug=slugify(smart_text(unidecode(shipping_zone_name))),defaults={"company_name": fake.company(), "address": create_address()},)warehouse.shipping_zones.add(shipping_zone)diff --git a/saleor/static/populatedb_data.json b/saleor/static/populatedb_data.jsonindex f722fd7c12..8bcdd10670 100644--- a/saleor/static/populatedb_data.json+++ b/saleor/static/populatedb_data.json@@ -283,6 +283,7 @@}},"name": "Paint",+ "slug": "paint","has_variants": true,"is_shipping_required": true,"is_digital": false,@@ -303,6 +304,7 @@}},"name": "Music",+ "slug": "music","has_variants": true,"is_shipping_required": true,"is_digital": false,@@ -323,6 +325,7 @@}},"name": "Juice",+ "slug": "juice","has_variants": true,"is_shipping_required": true,"is_digital": false,@@ -343,6 +346,7 @@}},"name": "Wine",+ "slug": "wine","has_variants": false,"is_shipping_required": true,"is_digital": false,@@ -363,6 +367,7 @@}},"name": "Beer",+ "slug": "beer","has_variants": false,"is_shipping_required": true,"is_digital": false,@@ -383,6 +388,7 @@}},"name": "Cushion",+ "slug": "cushion","has_variants": true,"is_shipping_required": true,"is_digital": false,@@ -403,6 +409,7 @@}},"name": "Shoe",+ "slug": "shoe","has_variants": true,"is_shipping_required": true,"is_digital": false,@@ -423,6 +430,7 @@}},"name": "Top (clothing)",+ "slug": "top-clothing","has_variants": true,"is_shipping_required": true,"is_digital": false,