Skip to content

Commit

Permalink
Send invitationer baseret på tidligere invitationer i Admin > Invitat…
Browse files Browse the repository at this point in the history
…ioner

På samme måde som personer kan vælges i Admin > Deltagere, Admin > Personer og Admin > Ventelister
  • Loading branch information
mhewel committed Nov 28, 2024
1 parent 3729709 commit bea87bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion members/admin/activityinvite_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
Person,
)

from members.admin.admin_actions import AdminActions


class ActivityInviteAdminForm(forms.ModelForm):
class Meta:
Expand Down Expand Up @@ -166,7 +168,11 @@ class Meta:
"Du kan søge på forening, afdeling, aktivitet eller person. <br>Vandret dato-filter er for aktivitetens startdato."
)

actions = ["export_csv_invitation_info", "extend_invitations"]
actions = [
"export_csv_invitation_info",
"extend_invitations",
AdminActions.invite_many_to_activity_action,
]

form = ActivityInviteAdminForm

Expand Down
4 changes: 4 additions & 0 deletions members/admin/admin_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ class MassInvitationForm(forms.Form):
elif queryset.model is ActivityParticipant:
q = [pa.person.pk for pa in queryset]
persons = Person.objects.filter(pk__in=q)
elif queryset.model is ActivityInvite:
persons = Person.objects.filter(
pk__in=queryset.values_list("person_id", flat=True)
)
else:
persons = queryset

Expand Down

0 comments on commit bea87bd

Please sign in to comment.