From 5b9550eb024d61858a92d79d4455b836bebca24d Mon Sep 17 00:00:00 2001 From: mhewel <58829786+mhewel@users.noreply.github.com> Date: Sun, 10 Sep 2023 11:12:57 +0200 Subject: [PATCH] Admin > Invite: Added new boolean for participating --- members/admin/activityinvite_admin.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/members/admin/activityinvite_admin.py b/members/admin/activityinvite_admin.py index 7d75c03c..230391b9 100644 --- a/members/admin/activityinvite_admin.py +++ b/members/admin/activityinvite_admin.py @@ -137,6 +137,7 @@ def get_form(self, request, obj=None, change=False, **kwargs): "invite_dtm", "expire_dtm", "rejected_at", + "participating", ) list_filter = ( ActivityInviteUnionListFilter, @@ -244,3 +245,12 @@ def person_link(self, item): person_link.short_description = "Person" person_link.admin_order_field = "person__name" + + def participating(self, item): + return ( + item.person.activityparticipant_set.filter(activity=item.activity).count() + > 0 + ) + + participating.short_description = "Deltager" + participating.boolean = True