Skip to content

Commit 3ac712d

Browse files
committed
Show included grant reimbursements on Grant admin changelist
Add the existing approved_amounts_display column to list_display so staff can see category names and amounts next to the total without opening each grant. Empty grants show an em dash.
1 parent 62df6d5 commit 3ac712d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

backend/grants/admin.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ class GrantAdmin(ExportMixin, ConferencePermissionMixin, admin.ModelAdmin):
475475
"conference",
476476
"current_or_pending_status",
477477
"total_amount_display",
478+
"approved_amounts_display",
478479
"country_type",
479480
"user_has_ticket",
480481
"has_voucher",
@@ -683,11 +684,12 @@ def has_sent_invitation_letter_request(self, obj: Grant) -> bool:
683684
def total_amount_display(self, obj):
684685
return f"{obj.total_allocated_amount:.2f}"
685686

686-
@admin.display(description="Approved Reimbursements")
687-
def approved_amounts_display(self, obj):
688-
return ", ".join(
687+
@admin.display(description="Included reimbursements")
688+
def approved_amounts_display(self, obj: Grant) -> str:
689+
text = ", ".join(
689690
f"{r.category.name}: {r.granted_amount}" for r in obj.reimbursements.all()
690691
)
692+
return text or "—"
691693

692694
def get_queryset(self, request):
693695
qs = (

0 commit comments

Comments
 (0)