Skip to content

Commit cd67582

Browse files
committed
Fix search by emergency countries n+1 queries
1 parent 82bf380 commit cd67582

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ def get(self, request):
435435
"funding_coverage": data.amount_funded,
436436
"start_date": data.disaster_start_date,
437437
"score": data.score,
438-
"countries": Country.objects.filter(id__in=data.countries_id),
438+
"countries": [{"id": id, "name": name} for id, name in zip(data.countries_id, data.countries)],
439439
"severity_level_display": data.crisis_categorization,
440440
"appeal_type": data.appeal_type,
441441
"severity_level": data.severity_level,

0 commit comments

Comments
 (0)