Skip to content

Commit

Permalink
Merge pull request #2226 from IFRCGo/fix/fdrs-issue
Browse files Browse the repository at this point in the history
Fix Fdrs sentry issue on cronjob
  • Loading branch information
szabozoltan69 authored Jul 24, 2024
2 parents 9e8f520 + 4689dc9 commit f3937bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion databank/management/commands/sources/FDRS.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ def load(country, overview, fdrs_data):
if country.iso is None or fdrs_data is None:
return

fdrs_data_fetched_year = max(int(item["year"]) for item in fdrs_data.values())
fdrs_data_fetched_year = max(
int(item["year"]) for item in fdrs_data.values() if item is not None and item.get("year") is not None
)

for fdrs_indicator, field in FDRS_INDICATORS_FIELD_MAP:
value = fdrs_data.get(f"{country.iso.upper()}-{fdrs_indicator}")
Expand Down

0 comments on commit f3937bd

Please sign in to comment.