Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPS: Ajouter le département des bénéficiaires dans l’admin [GEN-1850] #4436

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()])