diff --git a/djstripe/migrations/0001_initial.py b/djstripe/migrations/0001_initial.py index 4cad9d93a7..7431e88b90 100644 --- a/djstripe/migrations/0001_initial.py +++ b/djstripe/migrations/0001_initial.py @@ -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( @@ -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.')), diff --git a/djstripe/models.py b/djstripe/models.py index 4bcff83ca2..718024c80d 100644 --- a/djstripe/models.py +++ b/djstripe/models.py @@ -771,6 +771,7 @@ class Customer(StripeObject): ) ) business_vat_id = StripeCharField( + blank=True, max_length=20, null=True, stripe_required=False, @@ -787,7 +788,7 @@ class Customer(StripeObject): help_text="Whether or not the latest charge for the customer's latest invoice has failed." ) # - 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." @@ -798,7 +799,7 @@ class Customer(StripeObject): ) # 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( @@ -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`." ))