Skip to content

Commit e809b95

Browse files
committed
fixes description of transaction on renewals
1 parent 6198bb3 commit e809b95

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

saas/renewals.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,15 @@ def extend_subscription(subscription, at_time=None, dry_run=False):
236236
if not dry_run:
237237
try:
238238
with transaction.atomic():
239-
subscription.extends()
240-
for use in subscription.uses.all():
241-
use.extends()
239+
# We need to create the order before extending
240+
# the `Subscription` otherwise, the order will show
241+
# an extra period in the `Transaction` description.
242242
invoiced_item = Transaction.objects.new_subscription_order(
243243
subscription, created_at=at_time)
244244
invoiced_item.save()
245+
subscription.extends()
246+
for use in subscription.uses.all():
247+
use.extends()
245248
except Exception as err: #pylint:disable=broad-except
246249
# logs any kind of errors
247250
# and move on to the next subscription.

0 commit comments

Comments
 (0)