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:
Aman Agrawal 2023-12-09 15:41:53 +00:00 committed by Tim Abbott
parent 3ff14dc018
commit a1fa969693
1 changed files with 5 additions and 0 deletions

View File

@ -410,6 +410,8 @@ def populate_remote_server(customer_profile: CustomerProfile) -> Dict[str, str]:
hostname=f"{unique_id}.example.com",
contact_email=f"{unique_id}@example.com",
plan_type=plan_type,
# TODO: Save property audit log data for server.
last_audit_log_update=timezone_now(),
)
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)
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()
assert customer.stripe_customer_id is not None
add_card_to_customer(customer)