Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

home: Use get_customer_by_realm for getting customer.

Vishnu KScbd73a6dc1dd
diff --git a/zerver/views/home.py b/zerver/views/home.py
index 7658bd47b20..75d0d1320cb 100644
--- a/zerver/views/home.py
+++ b/zerver/views/home.py
@@ -290,9 +290,9 @@ def home_real(request: HttpRequest) -> HttpResponse:
show_billing = False
show_plans = False
if settings.CORPORATE_ENABLED and user_profile is not None:
- from corporate.models import Customer, CustomerPlan
+ from corporate.models import CustomerPlan, get_customer_by_realm
if user_profile.has_billing_access:
- customer = Customer.objects.filter(realm=user_profile.realm).first()
+ customer = get_customer_by_realm(user_profile.realm)
if customer is not None:
if customer.sponsorship_pending:
show_billing = True