Fix mypy warning
authorSybren A. Stüvel <sybren@blender.org>
Thu, 15 Aug 2019 09:28:52 +0000 (11:28 +0200)
committerSybren A. Stüvel <sybren@blender.org>
Thu, 15 Aug 2019 09:28:52 +0000 (11:28 +0200)
blender_fund_main/page_models.py

index 61234e0f3af41d34d2ac5d3530e826cc0f1b7a45..d036ae387967110c0b9950e0e75e96ddcf7bd0e7 100644 (file)
@@ -118,10 +118,13 @@ class HomePage(Page):
             settings.FUND_INCOME_TARGET, to_currency=currency)
 
         total_income = self.total_income_in_currency(currency)
-        thermo_percentages = {
-            cat: int(100. * (income_for_cat / fund_income_target_pref))
-            for cat, income_for_cat in total_income.items()
-        }
+        thermo_percentages = {}
+        for cat, income_for_cat in total_income.items():
+            ratio = income_for_cat / fund_income_target_pref
+            assert isinstance(ratio, float)
+
+            percentage = int(100. * ratio)
+            thermo_percentages[cat] = percentage
 
         # Convert from cents to kilo-currency.
         thermo_high = fund_income_target_pref.cents // 100_000