Skip to content

Commit

Permalink
Fix search by emergency countries n+1 queries
Browse files Browse the repository at this point in the history
  • Loading branch information
szabozoltan69 committed Jul 3, 2024
1 parent 82bf380 commit cd67582
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def get(self, request):
"funding_coverage": data.amount_funded,
"start_date": data.disaster_start_date,
"score": data.score,
"countries": Country.objects.filter(id__in=data.countries_id),
"countries": [{"id": id, "name": name} for id, name in zip(data.countries_id, data.countries)],
"severity_level_display": data.crisis_categorization,
"appeal_type": data.appeal_type,
"severity_level": data.severity_level,
Expand Down

0 comments on commit cd67582

Please sign in to comment.