Skip to content

Commit

Permalink
Mark customer coupon, shipping and days_until_due as blank=True
Browse files Browse the repository at this point in the history
  • Loading branch information
jamezpolley authored and jleclanche committed Jul 18, 2018
1 parent 23fec03 commit f81f28d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions djstripe/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ class Migration(migrations.Migration):
('coupon_start', djstripe.fields.StripeDateTimeField(editable=False, help_text='If a coupon is present, the date at which it was applied.', null=True)),
('coupon_end', djstripe.fields.StripeDateTimeField(editable=False, help_text='If a coupon is present and has a limited duration, the date that the discount will end.', null=True)),
('email', djstripe.fields.StripeTextField(null=True)),
('shipping', djstripe.fields.StripeJSONField(help_text='Shipping information associated with the customer.', null=True)),
('shipping', djstripe.fields.StripeJSONField(help_text='Shipping information associated with the customer.', null=True, blank=True)),
('date_purged', models.DateTimeField(editable=False, null=True)),
('coupon', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='djstripe.Coupon')),
('coupon', models.ForeignKey(null=True, blank=True, on_delete=django.db.models.deletion.SET_NULL, to='djstripe.Coupon')),
],
),
migrations.CreateModel(
Expand Down Expand Up @@ -516,7 +516,7 @@ class Migration(migrations.Migration):
('canceled_at', djstripe.fields.StripeDateTimeField(blank=True, help_text='If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with ``cancel_at_period_end``, canceled_at will still reflect the date of the initial cancellation request, not the end of the subscription period when the subscription is automatically moved to a canceled state.', null=True)),
('current_period_end', djstripe.fields.StripeDateTimeField(help_text='End of the current period for which the subscription has been invoiced. At the end of this period, a new invoice will be created.')),
('current_period_start', djstripe.fields.StripeDateTimeField(help_text='Start of the current period for which the subscription has been invoiced.')),
('days_until_due', djstripe.fields.StripeIntegerField(help_text='Number of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `billing=charge_automatically`.', null=True)),
('days_until_due', djstripe.fields.StripeIntegerField(help_text='Number of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `billing=charge_automatically`.', null=True, blank=True)),
('ended_at', djstripe.fields.StripeDateTimeField(blank=True, help_text='If the subscription has ended (either because it was canceled or because the customer was switched to a subscription to a new plan), the date the subscription ended.', null=True)),
('quantity', djstripe.fields.StripeIntegerField(help_text='The quantity applied to this subscription.')),
('start', djstripe.fields.StripeDateTimeField(help_text='Date the subscription started.')),
Expand Down
7 changes: 4 additions & 3 deletions djstripe/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ class Customer(StripeObject):
)
)
business_vat_id = StripeCharField(
blank=True,
max_length=20,
null=True,
stripe_required=False,
Expand All @@ -787,7 +788,7 @@ class Customer(StripeObject):
help_text="Whether or not the latest charge for the customer's latest invoice has failed."
)
# <discount>
coupon = ForeignKey("Coupon", null=True, on_delete=SET_NULL)
coupon = ForeignKey("Coupon", null=True, blank=True, on_delete=SET_NULL)
coupon_start = StripeDateTimeField(
null=True, editable=False, stripe_name="discount.start", stripe_required=False,
help_text="If a coupon is present, the date at which it was applied."
Expand All @@ -798,7 +799,7 @@ class Customer(StripeObject):
)
# </discount>
email = StripeTextField(null=True)
shipping = StripeJSONField(stripe_required=False, help_text="Shipping information associated with the customer.")
shipping = StripeJSONField(blank=True, stripe_required=False, help_text="Shipping information associated with the customer.")

# dj-stripe fields
subscriber = ForeignKey(
Expand Down Expand Up @@ -2823,7 +2824,7 @@ class Subscription(StripeObject):
related_name="subscriptions",
help_text="The customer associated with this subscription."
)
days_until_due = StripeIntegerField(stripe_required=False, help_text=(
days_until_due = StripeIntegerField(blank=True, stripe_required=False, help_text=(
"Number of days a customer has to pay invoices generated by this subscription. "
"This value will be `null` for subscriptions where `billing=charge_automatically`."
))
Expand Down

0 comments on commit f81f28d

Please sign in to comment.