billing: Wrap make_end_of_cycle_updates_if_needed with transaction.atomic.

Otherwise, the plan would be left in an inconsistent state if one of the
queries fail.
This commit is contained in:
Vishnu KS
2020-06-18 21:27:27 +05:30
committed by Tim Abbott
parent cde4486f8c
commit 508ba663dc
3 changed files with 10 additions and 4 deletions

View File

@@ -204,6 +204,7 @@ def billing_home(request: HttpRequest) -> HttpResponse:
if last_ledger_entry is not None:
if new_plan is not None: # nocoverage
plan = new_plan
assert(plan is not None) # for mypy
plan_name = {
CustomerPlan.STANDARD: 'Zulip Standard',
CustomerPlan.PLUS: 'Zulip Plus',