Skip to content

Commit

Permalink
feat: only one row per application on csv report
Browse files Browse the repository at this point in the history
  • Loading branch information
rikuke committed Oct 16, 2024
1 parent 6096bab commit fed90d1
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from datetime import datetime
from typing import Union

from django.utils import translation

from applications.enums import ApplicationBatchStatus
from applications.models import Application
from applications.services.applications_csv_report import (
Expand Down Expand Up @@ -36,9 +38,6 @@ def get_alteration_amount(self, application: Application) -> float:

@property
def CSV_COLUMNS(self):
"""
Customize the CSV columns but also return the parent class's columns.
"""
calculated_benefit_amount = "calculation.calculated_benefit_amount"

columns = [
Expand Down Expand Up @@ -112,3 +111,9 @@ def CSV_COLUMNS(self):
]

return columns

def get_row_items(self):
with translation.override("fi"):
for application in self.get_applications():
application.application_row_idx = 1
yield application

0 comments on commit fed90d1

Please sign in to comment.