From c25d66b9f8b6495735b36efd56e455a497c51729 Mon Sep 17 00:00:00 2001 From: Tudor Amariei Date: Mon, 27 May 2024 22:11:16 +0300 Subject: [PATCH] Fix donations download --- backend/donations/views/donations_download.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/donations/views/donations_download.py b/backend/donations/views/donations_download.py index 4ee45fc4..95418ee7 100644 --- a/backend/donations/views/donations_download.py +++ b/backend/donations/views/donations_download.py @@ -319,7 +319,9 @@ def _generate_donations_by_county(cnp_idx, ngo, ngo_donations, zip_64_flag, zip_ for i in range(math.ceil(current_county_count / donations_limit)): xml_name: str = f"d230_{county_code}_{xml_count:04}.xml" - county_donations: QuerySet[Donor] = ngo_donations.filter(county=current_county)[:donations_limit] + county_donations: QuerySet[Donor] = ngo_donations.filter(county=current_county)[ + i * donations_limit : (i + 1) * donations_limit + ] _build_xml(ngo, county_donations, xml_count, xml_name, cnp_idx, zip_timestamp, zip_archive, zip_64_flag) xml_count += 1