Skip to content

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

Use default_country in initial channel migration (#10283)

Marcin Gębala280f257b2458
diff --git a/saleor/channel/migrations/0001_initial.py b/saleor/channel/migrations/0001_initial.py
index b8d6dd050f..70193693c1 100644
--- a/saleor/channel/migrations/0001_initial.py
+++ b/saleor/channel/migrations/0001_initial.py
@@ -1,5 +1,6 @@
# Generated by Django 3.0.6 on 2020-06-16 07:54
+import os
from django.conf import settings
from django.db import migrations, models
from django.db.models.signals import post_migrate
@@ -54,12 +55,14 @@ def create_default_channel(apps, schema_editor):
default_currency = get_default_currency(
Checkout, Order, Product, ShippingMethod, Voucher
)
+ default_country = os.environ.get("DEFAULT_COUNTRY", "US")
if default_currency:
Channel.objects.create(
name="Default channel",
slug=settings.DEFAULT_CHANNEL_SLUG,
currency_code=default_currency,
is_active=True,
+ default_country=default_country,
)