diff --git a/rating/scripts/report/company_profile.py b/rating/scripts/report/company_profile.py index e640cc9..902acd2 100644 --- a/rating/scripts/report/company_profile.py +++ b/rating/scripts/report/company_profile.py @@ -336,7 +336,10 @@ def calculate_tuple(param1, param2, param3, param4): amount += item['amount'] except TypeError: amount += 0 - concentration = round(amount / param3 * 100, 2) + try: + concentration = round(amount / param3 * 100, 2) + except ZeroDivisionError: + concentration = 0 if concentration > 60: result['concentration'] = '高' elif concentration > 40: