Skip to content

Commit 7d3b90a

Browse files
authored
Merge pull request #314 from dinesh-aot/COMP-476
regulated-party change in report
2 parents fdfec84 + f90ced7 commit 7d3b90a

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

compliance-api/src/compliance_api/services/inspection_record/inspection_record_builder.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,15 @@ def _build_officer_attendance(self):
134134
attendance_list.append(option.data)
135135
else:
136136
# If no data, use the attendance option name
137-
attendance_list.append(option.attendance_option.name)
137+
if (
138+
option.attendance_option_id
139+
== InspectionAttendanceOptionEnum.CERTIFICATE_HOLDER_OR_REGULATED_PARTY_REPRESENTATIVE.value
140+
):
141+
if not self.data.get("project_details"):
142+
self.build_project_details()
143+
attendance_list.append(self.data["project_details"]["proponent"])
144+
else:
145+
attendance_list.append(option.attendance_option.name)
138146

139147
# Join all attendance items with commas
140148
attendance_string = ", ".join(attendance_list) if attendance_list else ""
@@ -285,7 +293,9 @@ def build_preliminary_review_details(self):
285293
if self.ir_status == IRStatusEnum.PRELIMINARY.value:
286294
preliminary_review_details = None
287295
elif self.ir_status == IRStatusEnum.FINAL.value:
288-
inspection_record = InspectionRecordModel.get_by_inspection_id(self.inspection.id)
296+
inspection_record = InspectionRecordModel.get_by_inspection_id(
297+
self.inspection.id
298+
)
289299
approvals = InspectionRecordApprovalModel.get_approvals_by_ir(
290300
inspection_record.id
291301
)
@@ -306,7 +316,9 @@ def build_preliminary_review_details(self):
306316
# Bulid the project details if not yet build to get the proponent label
307317
if not self.data.get("project_details"):
308318
self.build_project_details()
309-
data["proponent_label"] = self.data["project_details"]["proponent_label"]
319+
data["proponent_label"] = self.data["project_details"][
320+
"proponent_label"
321+
]
310322
data["primary_last_name"] = self.inspection.primary_officer.last_name
311323
preliminary_review_details = render_template_with_data(
312324
"PRELIMINARY_REVIEW_DETAILS", PRELIMINARY_REVIEW_DETAILS, data

compliance-api/src/compliance_api/templates/ir_template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
</tr>
353353
<tr>
354354
<th>Record Prepared By</th>
355-
<td colspan="3">{{ officer_details.primary_officer.name }},&nbsp;{{
355+
<td colspan="3">{{ officer_details.primary_officer.name }}</br>{{
356356
officer_details.primary_officer.position }}</td>
357357
</tr>
358358
<tr>

0 commit comments

Comments
 (0)