From a4427dd3afef8c894b16dc67f9a509833443363d Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 13 Apr 2019 14:40:20 +0200 Subject: [PATCH] Set empty string for description if not available --- hosting/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hosting/models.py b/hosting/models.py index ea776389..aeed606f 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -336,7 +336,9 @@ class MonthlyHostingBill(AssignPermissionsMixin, models.Model): line_item_instance = HostingBillLineItem.objects.create( monthly_hosting_bill=instance, amount=item.amount, - description=item.description, + # description seems to be set to null in the Stripe + # response for an invoice + description="" if item.description is None else item.description, discountable=item.discountable, metadata=json.dumps(item.metadata), period_start=datetime.utcfromtimestamp(item.period.start).replace(tzinfo=pytz.utc), period_end=datetime.utcfromtimestamp(item.period.end).replace(tzinfo=pytz.utc),