Skip to content

Commit

Permalink
feat: make State/Region fields optional
Browse files Browse the repository at this point in the history
  • Loading branch information
henri-hulski committed May 4, 2022
1 parent 45707fb commit 6f52d1b
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Generated by Django 4.0.4 on 2022-05-04 12:24

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("shop", "0009_product_slug"),
]

operations = [
migrations.AlterField(
model_name="discountcode",
name="categories",
field=models.ManyToManyField(
blank=True,
related_name="%(class)s_related",
to="shop.category",
verbose_name="Categories",
),
),
migrations.AlterField(
model_name="order",
name="billing_detail_state",
field=models.CharField(
blank=True, max_length=100, verbose_name="State/Region"
),
),
migrations.AlterField(
model_name="order",
name="shipping_detail_state",
field=models.CharField(
blank=True, max_length=100, verbose_name="State/Region"
),
),
migrations.AlterField(
model_name="product",
name="related_products",
field=models.ManyToManyField(
blank=True, to="shop.product", verbose_name="Related products"
),
),
migrations.AlterField(
model_name="product",
name="upsell_products",
field=models.ManyToManyField(
blank=True, to="shop.product", verbose_name="Upsell products"
),
),
migrations.AlterField(
model_name="sale",
name="categories",
field=models.ManyToManyField(
blank=True,
related_name="%(class)s_related",
to="shop.category",
verbose_name="Categories",
),
),
]
4 changes: 2 additions & 2 deletions cartridge/shop/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ class Order(SiteRelated):
billing_detail_last_name = CharField(_("Last name"), max_length=100)
billing_detail_street = CharField(_("Street"), max_length=100)
billing_detail_city = CharField(_("City/Suburb"), max_length=100)
billing_detail_state = CharField(_("State/Region"), max_length=100)
billing_detail_state = CharField(_("State/Region"), max_length=100, blank=True)
billing_detail_postcode = CharField(_("Zip/Postcode"), max_length=10)
billing_detail_country = CharField(_("Country"), max_length=100)
billing_detail_phone = CharField(_("Phone"), max_length=20)
Expand All @@ -462,7 +462,7 @@ class Order(SiteRelated):
shipping_detail_last_name = CharField(_("Last name"), max_length=100)
shipping_detail_street = CharField(_("Street"), max_length=100)
shipping_detail_city = CharField(_("City/Suburb"), max_length=100)
shipping_detail_state = CharField(_("State/Region"), max_length=100)
shipping_detail_state = CharField(_("State/Region"), max_length=100, blank=True)
shipping_detail_postcode = CharField(_("Zip/Postcode"), max_length=10)
shipping_detail_country = CharField(_("Country"), max_length=100)
shipping_detail_phone = CharField(_("Phone"), max_length=20)
Expand Down

0 comments on commit 6f52d1b

Please sign in to comment.