From 920074e8f1125ae1cc17ab4818545060864ed9b4 Mon Sep 17 00:00:00 2001 From: Jing Cheng Date: Tue, 3 Dec 2024 15:53:18 -0500 Subject: [PATCH] Show -- for the total if the account has no mobile worker yet --- corehq/apps/enterprise/enterprise.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/corehq/apps/enterprise/enterprise.py b/corehq/apps/enterprise/enterprise.py index 848ede497bf1..83b39a7cf0ef 100644 --- a/corehq/apps/enterprise/enterprise.py +++ b/corehq/apps/enterprise/enterprise.py @@ -451,5 +451,7 @@ def total(self): if domain_mobile_workers: total_mobile_workers += domain_mobile_workers total_up_to_date += domain_mobile_workers - len(self.rows_for_domain(domain_obj)) - percentage = (total_up_to_date / total_mobile_workers) if total_mobile_workers else 0 + if not total_mobile_workers: + return '--' + percentage = (total_up_to_date / total_mobile_workers) return f"{percentage * 100:.0f}%"