Allow None value for billing_reason

This commit is contained in:
PCoder 2019-11-28 13:59:03 +05:30
parent bed57786d7
commit cc5d82ccac

View file

@ -345,7 +345,10 @@ class MonthlyHostingBill(AssignPermissionsMixin, models.Model):
args['period_start']).replace(tzinfo=pytz.utc), args['period_start']).replace(tzinfo=pytz.utc),
period_end=datetime.utcfromtimestamp( period_end=datetime.utcfromtimestamp(
args['period_end']).replace(tzinfo=pytz.utc), args['period_end']).replace(tzinfo=pytz.utc),
billing_reason=args['billing_reason'], billing_reason=(
args['billing_reason']
if args['billing_reason'] is not None else ''
),
discount=args['discount'], discount=args['discount'],
total=args['total'], total=args['total'],
lines_data_count=args['lines_data_count'], lines_data_count=args['lines_data_count'],