Skip to content

Commit

Permalink
Merge pull request #2300 from IFRCGo/fix/fts-hpc-issue
Browse files Browse the repository at this point in the history
Fix fts-hpc source issue in databank
  • Loading branch information
szabozoltan69 authored Nov 6, 2024
2 parents fba1803 + da617f6 commit ea5dce1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion databank/management/commands/sources/FTS_HPC.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def prefetch():
f"{d['Country #country+code'].upper()}-{d['Year #date+year']}": {
"people_in_need": d["PIN #inneed"],
"people_targeted": d["PT #targeted"],
"funding_total_usd": d["Funding #value+funding+total+usd"],
"funding_total_usd": d["Funding #value+required+total+usd"],
"funding_required_usd": d["Requirements #value+funding+required+usd"],
}
for d in g_sheet_data
Expand Down
2 changes: 1 addition & 1 deletion per/drf_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def get(self, request, pk, format=None):
"Benchmark descprition",
"Benchmark answer (Yes/No/Partially)",
"Benchmark notes",
"Consideration notes epi",
"Consideration notes epidemic",
"Consideration notes urban",
"Consideration notes climate",
"Component rating",
Expand Down
5 changes: 4 additions & 1 deletion per/ops_learning_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,10 @@ def secondary_response_save_to_db(
subtype = value["subtype"].strip()
content = value["content"].strip()
excerpt_ids = value["excerpts id"]
excerpt_id_list = list(set(int(id.strip()) for id in excerpt_ids.split(",") if excerpt_ids != ""))
if isinstance(excerpt_ids, list):
excerpt_id_list = list(set(excerpt_ids if excerpt_ids else []))
else:
excerpt_id_list = list(set(int(id.strip()) for id in excerpt_ids.split(",") if excerpt_ids and excerpt_ids != ""))

if type == "component" and len(excerpt_id_list) > 0:
cls.add_used_ops_learnings_component(
Expand Down

0 comments on commit ea5dce1

Please sign in to comment.