mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 12:54:58 +00:00
populate_billing_realms: Add temporary fix for MissingDataError.
We need to add proper logs here, which can probably be copied from test_current_count_for_billed_licenses.
This commit is contained in:
@@ -410,6 +410,8 @@ def populate_remote_server(customer_profile: CustomerProfile) -> Dict[str, str]:
|
|||||||
hostname=f"{unique_id}.example.com",
|
hostname=f"{unique_id}.example.com",
|
||||||
contact_email=f"{unique_id}@example.com",
|
contact_email=f"{unique_id}@example.com",
|
||||||
plan_type=plan_type,
|
plan_type=plan_type,
|
||||||
|
# TODO: Save property audit log data for server.
|
||||||
|
last_audit_log_update=timezone_now(),
|
||||||
)
|
)
|
||||||
|
|
||||||
billing_session = RemoteServerBillingSession(remote_server)
|
billing_session = RemoteServerBillingSession(remote_server)
|
||||||
@@ -483,6 +485,9 @@ def populate_remote_realms(customer_profile: CustomerProfile) -> Dict[str, str]:
|
|||||||
|
|
||||||
remote_realm = RemoteRealm.objects.get(uuid=local_realm.uuid)
|
remote_realm = RemoteRealm.objects.get(uuid=local_realm.uuid)
|
||||||
billing_session = RemoteRealmBillingSession(remote_realm)
|
billing_session = RemoteRealmBillingSession(remote_realm)
|
||||||
|
# TODO: Save property audit log data for server.
|
||||||
|
remote_realm.server.last_audit_log_update = timezone_now()
|
||||||
|
remote_realm.server.save(update_fields=["last_audit_log_update"])
|
||||||
customer = billing_session.update_or_create_stripe_customer()
|
customer = billing_session.update_or_create_stripe_customer()
|
||||||
assert customer.stripe_customer_id is not None
|
assert customer.stripe_customer_id is not None
|
||||||
add_card_to_customer(customer)
|
add_card_to_customer(customer)
|
||||||
|
|||||||
Reference in New Issue
Block a user