From da617f6324b5de13a9e8e2ce67d84cc1261cf9c3 Mon Sep 17 00:00:00 2001 From: Sushil Tiwari Date: Wed, 6 Nov 2024 10:11:32 +0545 Subject: [PATCH] Fix fts-hpc-issue and sentry issue --- databank/management/commands/sources/FTS_HPC.py | 2 +- per/drf_views.py | 2 +- per/ops_learning_summary.py | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/databank/management/commands/sources/FTS_HPC.py b/databank/management/commands/sources/FTS_HPC.py index 27f532385..442a8b01b 100644 --- a/databank/management/commands/sources/FTS_HPC.py +++ b/databank/management/commands/sources/FTS_HPC.py @@ -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 diff --git a/per/drf_views.py b/per/drf_views.py index 0afae903a..e00908b0f 100644 --- a/per/drf_views.py +++ b/per/drf_views.py @@ -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", diff --git a/per/ops_learning_summary.py b/per/ops_learning_summary.py index f90754324..2fd323d54 100644 --- a/per/ops_learning_summary.py +++ b/per/ops_learning_summary.py @@ -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(