Skip to content

Commit

Permalink
gps: Add beneficiary department in gps admin list
Browse files Browse the repository at this point in the history
  • Loading branch information
tonial committed Jul 16, 2024
1 parent 263ccf9 commit b775080
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion itou/gps/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class FollowUpGroupMembershipAdmin(ItouModelAdmin):

@admin.register(models.FollowUpGroup)
class FollowUpGroupAdmin(ItouModelAdmin):
list_display = ("created_at", "updated_at", "beneficiary", "display_members")
list_display = ("created_at", "updated_at", "beneficiary", "beneficiary_department", "display_members")
readonly_fields = [
"created_in_bulk",
]
Expand All @@ -55,6 +55,10 @@ class FollowUpGroupAdmin(ItouModelAdmin):

inlines = (MemberInline,)

@admin.display(description="Département")
def beneficiary_department(self, obj):
return obj.beneficiary.department

@admin.display(description="Membres du groupe de suivi")
def display_members(self, obj):
return ", ".join([m.get_full_name() for m in obj.members.all()])

0 comments on commit b775080

Please sign in to comment.