From 5ce6cde06d0cba2dde5f7bede20cbae460579926 Mon Sep 17 00:00:00 2001 From: Pawan Verma Date: Thu, 21 Nov 2024 13:40:04 +0530 Subject: [PATCH] Fix error in payment unit admin --- commcare_connect/opportunity/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commcare_connect/opportunity/admin.py b/commcare_connect/opportunity/admin.py index e833dd19..2c026ec3 100644 --- a/commcare_connect/opportunity/admin.py +++ b/commcare_connect/opportunity/admin.py @@ -127,8 +127,8 @@ def get_username(self, obj): @admin.register(PaymentUnit) class PaymentUnitAdmin(admin.ModelAdmin): list_display = ["name", "get_opp_name"] - search_fields = ["name"] + search_fields = ["name", "opportunity__name"] @admin.display(description="Opportunity Name") def get_opp_name(self, obj): - return obj.opportunity_access.opportunity.name + return obj.opportunity.name