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:
parent
691a03ecad
commit
fb5796d35e
10 changed files with 279 additions and 158 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue