stripe: Order downgrade_small_realms_behind_on_payments_as_needed query.

Fixes nondeterminism that broke
test_downgrade_small_realms_behind_on_payments_as_needed.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2025-10-10 01:48:57 -07:00
committed by Tim Abbott
parent 9bb082a315
commit f04f3bcbfc

View File

@@ -5702,7 +5702,9 @@ def customer_has_last_n_invoices_open(customer: Customer, n: int) -> bool:
def downgrade_small_realms_behind_on_payments_as_needed() -> None: def downgrade_small_realms_behind_on_payments_as_needed() -> None:
customers = Customer.objects.all().exclude(stripe_customer_id=None).exclude(realm=None) customers = (
Customer.objects.all().exclude(stripe_customer_id=None).exclude(realm=None).order_by("id")
)
for customer in customers: for customer in customers:
realm = customer.realm realm = customer.realm
assert realm is not None assert realm is not None