Skip to content

Commit

Permalink
Allow Product.attributes and .url to be blank
Browse files Browse the repository at this point in the history
They're not required if type="service"
  • Loading branch information
therefromhere authored and jleclanche committed Nov 14, 2018
1 parent 1b76c47 commit 8393a50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions djstripe/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,13 @@ class Migration(migrations.Migration):
('name', models.CharField(help_text="The product's name, meant to be displayable to the customer. Applicable to both `service` and `good` types.", max_length=5000)),
('type', djstripe.fields.StripeEnumField(enum=djstripe.enums.ProductType, help_text='The type of the product. The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans.', max_length=7)),
('active', models.NullBooleanField(help_text='Whether the product is currently available for purchase. Only applicable to products of `type=good`.')),
('attributes', djstripe.fields.JSONField(help_text='A list of up to 5 attributes that each SKU can provide values for (e.g., `["color", "size"]`). Only applicable to products of `type=good`.', null=True)),
('attributes', djstripe.fields.JSONField(help_text='A list of up to 5 attributes that each SKU can provide values for (e.g., `["color", "size"]`). Only applicable to products of `type=good`.', null=True, blank=True)),
('caption', models.CharField(help_text='A short one-line description of the product, meant to be displayableto the customer. Only applicable to products of `type=good`.', max_length=5000, null=True, blank=True)),
('deactivate_on', djstripe.fields.JSONField(blank=True, help_text='An array of connect application identifiers that cannot purchase this product. Only applicable to products of `type=good`.')),
('images', djstripe.fields.JSONField(blank=True, help_text='A list of up to 8 URLs of images for this product, meant to be displayable to the customer. Only applicable to products of `type=good`.')),
('package_dimensions', djstripe.fields.JSONField(help_text='The dimensions of this product for shipping purposes. A SKU associated with this product can override this value by having its own `package_dimensions`. Only applicable to products of `type=good`.', null=True, blank=True)),
('shippable', models.NullBooleanField(help_text='Whether this product is a shipped good. Only applicable to products of `type=good`.')),
('url', models.CharField(help_text='A URL of a publicly-accessible webpage for this product. Only applicable to products of `type=good`.', max_length=799, null=True)),
('url', models.CharField(help_text='A URL of a publicly-accessible webpage for this product. Only applicable to products of `type=good`.', max_length=799, null=True, blank=True)),
('statement_descriptor', models.CharField(help_text="Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. Only available on products of type=`service`.", max_length=22, null=True, blank=True)),
('unit_label', models.CharField(max_length=12, null=True)),
],
Expand Down
4 changes: 2 additions & 2 deletions djstripe/models/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ class Product(StripeModel):
)
)
attributes = JSONField(
null=True,
null=True, blank=True,
help_text=(
"A list of up to 5 attributes that each SKU can provide values for "
'(e.g., `["color", "size"]`). Only applicable to products of `type=good`.'
Expand Down Expand Up @@ -1349,7 +1349,7 @@ class Product(StripeModel):
)
url = models.CharField(
max_length=799,
null=True,
null=True, blank=True,
help_text=(
"A URL of a publicly-accessible webpage for this product. "
"Only applicable to products of `type=good`."
Expand Down

0 comments on commit 8393a50

Please sign in to comment.