From 3ac712df0d23eddce37b203889210629ff96be65 Mon Sep 17 00:00:00 2001 From: Ester Beltrami Date: Tue, 7 Apr 2026 12:26:28 +0100 Subject: [PATCH 1/2] 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. --- backend/grants/admin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/grants/admin.py b/backend/grants/admin.py index 8e9f732941..726269b788 100644 --- a/backend/grants/admin.py +++ b/backend/grants/admin.py @@ -475,6 +475,7 @@ class GrantAdmin(ExportMixin, ConferencePermissionMixin, admin.ModelAdmin): "conference", "current_or_pending_status", "total_amount_display", + "approved_amounts_display", "country_type", "user_has_ticket", "has_voucher", @@ -683,11 +684,12 @@ def has_sent_invitation_letter_request(self, obj: Grant) -> bool: def total_amount_display(self, obj): return f"{obj.total_allocated_amount:.2f}" - @admin.display(description="Approved Reimbursements") - def approved_amounts_display(self, obj): - return ", ".join( + @admin.display(description="Included reimbursements") + def approved_amounts_display(self, obj: Grant) -> str: + text = ", ".join( f"{r.category.name}: {r.granted_amount}" for r in obj.reimbursements.all() ) + return text or "—" def get_queryset(self, request): qs = ( From 58186253f370f78d87a32c28349f38090f98c750 Mon Sep 17 00:00:00 2001 From: Ester Beltrami Date: Tue, 7 Apr 2026 13:33:19 +0100 Subject: [PATCH 2/2] Format Grant admin money columns as whole numbers Use :.0f for Total and each reimbursement line so the changelist matches granted_amount (decimal_places=0) and avoids 100.00 vs 100 mismatch. --- backend/grants/admin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/grants/admin.py b/backend/grants/admin.py index 726269b788..04fea81c3d 100644 --- a/backend/grants/admin.py +++ b/backend/grants/admin.py @@ -681,13 +681,14 @@ def has_sent_invitation_letter_request(self, obj: Grant) -> bool: return "" @admin.display(description="Total") - def total_amount_display(self, obj): - return f"{obj.total_allocated_amount:.2f}" + def total_amount_display(self, obj: Grant) -> str: + return f"{obj.total_allocated_amount:.0f}" @admin.display(description="Included reimbursements") def approved_amounts_display(self, obj: Grant) -> str: text = ", ".join( - f"{r.category.name}: {r.granted_amount}" for r in obj.reimbursements.all() + f"{r.category.name}: {r.granted_amount:.0f}" + for r in obj.reimbursements.all() ) return text or "—"