Skip to content

Commit

Permalink
Admin > Invite: Added new boolean for participating
Browse files Browse the repository at this point in the history
  • Loading branch information
mhewel committed Sep 10, 2023
1 parent c01490d commit 5b9550e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions members/admin/activityinvite_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def get_form(self, request, obj=None, change=False, **kwargs):
"invite_dtm",
"expire_dtm",
"rejected_at",
"participating",
)
list_filter = (
ActivityInviteUnionListFilter,
Expand Down Expand Up @@ -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

0 comments on commit 5b9550e

Please sign in to comment.