We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 31f3212 + 2d69775 commit 36e342eCopy full SHA for 36e342e
ngo_explorer/classes/charitybasecharity.py
@@ -32,6 +32,8 @@ def _get_inflation(self):
32
max([int(i) for i in self._inflation.keys()]))
33
34
for f in self.finances:
35
+ if f.get("financialYear", {}).get("end") is None:
36
+ continue
37
year = f["financialYear"]["end"].year
38
inflator = self._inflation.get(
39
self._current_year) / self._inflation.get(str(year))
ngo_explorer/classes/charitybaseresult.py
@@ -54,7 +54,7 @@ def _parse_aggregates(self):
54
self.total_income_years = {}
55
if self.list:
56
for c in self.list:
57
- if c.finances:
+ if c.finances and c.finances[0].get("financialYear", {}).get("end"):
58
year = c.finances[0]["financialYear"]["end"].year
59
if year not in self.total_income_years:
60
self.total_income_years[year] = 0
0 commit comments