From d38775e021ef1170c0852c781c96cde884b3c124 Mon Sep 17 00:00:00 2001 From: selnem Date: Tue, 16 Jun 2026 20:04:41 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EB=AF=BC=EC=9B=90=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=9D=91=EB=8B=B5=EC=9D=84=20=EC=A7=81=EC=A0=91=20?= =?UTF-8?q?=EA=B5=AC=EC=84=B1=ED=95=B4=20lazy=20loading=20=EC=9C=84?= =?UTF-8?q?=ED=97=98=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/ComplaintPetitionService.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/app/services/ComplaintPetitionService.py b/app/services/ComplaintPetitionService.py index 125d593..899019d 100644 --- a/app/services/ComplaintPetitionService.py +++ b/app/services/ComplaintPetitionService.py @@ -242,10 +242,22 @@ async def create_petition_for_issue_pin( ) await self.complaint_petition_repo.save(petition, flush_immediately=True) - petition.location_department = location_department - petition.issue_pin = issue_pin - review = self._to_review_item(petition) - return ComplaintPetitionApplyResponse.model_validate(review.model_dump()) + return ComplaintPetitionApplyResponse( + petition_id=petition.petition_id, + issue_pin_id=issue_pin.issue_pin_id, + location_department_id=location_department.location_department_id, + location_id=location_id, + department_name=location_department.department.department_name if location_department.department else "", + location_department_email=location_department.location_department_email, + generated_on=target_generated_on.isoformat(), + pdf_s3_key=petition.pdf_s3_key, + pdf_s3_url=petition.pdf_s3_url, + email_subject=petition.email_subject, + email_body=petition.email_body, + reliability_score=petition.reliability_score, + reliability_basis=petition.reliability_basis, + status=petition.status, + ) async def list_for_review( self, @@ -578,7 +590,7 @@ def _to_review_item(petition: ComplaintPetition) -> ComplaintPetitionReviewItem: location_id=location_id, department_name=department_name, location_department_email=location_department_email, - generated_on=petition.generated_on.isoformat(), + generated_on=petition.generated_on.isoformat() if petition.generated_on is not None else "", pdf_s3_key=petition.pdf_s3_key, pdf_s3_url=petition.pdf_s3_url, email_subject=petition.email_subject, From eae408e87eb3bfc3e267f8d04cb494ded0c83474 Mon Sep 17 00:00:00 2001 From: selnem Date: Tue, 16 Jun 2026 20:12:45 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EB=AF=BC=EC=9B=90=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=9D=91=EB=8B=B5=EC=97=90=EC=84=9C=20=EA=B4=80?= =?UTF-8?q?=EA=B3=84=20=EC=9E=AC=EC=A0=91=EA=B7=BC=20=EC=A0=9C=EA=B1=B0?= =?UTF-8?q?=EB=A1=9C=20MissingGreenlet=20=EC=9C=84=ED=97=98=20=EC=B0=A8?= =?UTF-8?q?=EB=8B=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/ComplaintPetitionService.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/ComplaintPetitionService.py b/app/services/ComplaintPetitionService.py index 899019d..c50d1c4 100644 --- a/app/services/ComplaintPetitionService.py +++ b/app/services/ComplaintPetitionService.py @@ -247,7 +247,7 @@ async def create_petition_for_issue_pin( issue_pin_id=issue_pin.issue_pin_id, location_department_id=location_department.location_department_id, location_id=location_id, - department_name=location_department.department.department_name if location_department.department else "", + department_name=department_name, location_department_email=location_department.location_department_email, generated_on=target_generated_on.isoformat(), pdf_s3_key=petition.pdf_s3_key,