Skip to content

Commit

Permalink
Add username and opportunity name to search fields
Browse files Browse the repository at this point in the history
  • Loading branch information
pxwxnvermx committed Nov 19, 2024
1 parent f904b4c commit 9fdfd5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commcare_connect/opportunity/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class CompletedModuleAdmin(admin.ModelAdmin):
@admin.register(UserVisit)
class UserVisitAdmin(admin.ModelAdmin):
list_display = ["deliver_unit", "user", "opportunity", "status"]
search_fields = ["opportunity_access__user__username", "opportunity_access__opportunity__name"]


@admin.register(Assessment)
Expand All @@ -112,7 +113,7 @@ class AssessmentAdmin(admin.ModelAdmin):
@admin.register(CompletedWork)
class CompletedWorkAdmin(admin.ModelAdmin):
list_display = ["get_username", "get_opp_name", "opportunity_access", "payment_unit", "status"]
search_fields = ["get_username", "get_opp_name"]
search_fields = ["opportunity_access__user__username", "opportunity_access__opportunity__name"]

@admin.display(description="Opportunity Name")
def get_opp_name(self, obj):
Expand Down

0 comments on commit 9fdfd5a

Please sign in to comment.