mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 18:08:21 +02:00
Guests can't be invited more than 5 times a year and a member can't invite more than 3 people per activity.
This commit is contained in:
@ -77,6 +77,11 @@ class ActivityInviteView(LoginRequiredMixin, CreateView):
|
||||
form_class = GuestForm
|
||||
template_name = "activity/activity_invite.html"
|
||||
|
||||
def get_form(self, form_class=None):
|
||||
form = super().get_form(form_class)
|
||||
form.activity = Activity.objects.get(pk=self.kwargs["pk"])
|
||||
return form
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.activity = Activity.objects.get(pk=self.kwargs["pk"])
|
||||
return super().form_valid(form)
|
||||
|
Reference in New Issue
Block a user