@membership_required
def group_invite(request, slug, template_name='groups/group_invite.html'):
 group = get_object_or_404(Group, slug=slug, is_active=True)
 form = GroupInviteForm(initial={'group': group.pk, 'user': request.user.pk})
 return render(request, template_name, {'group': group, 'form': form})

@ membership_required def group_invite ( request , slug , template_name = 'groups/group_invite.html' ) : group = get_object_or_404 ( Group , slug = slug , is_active = True ) form = GroupInviteForm ( initial = { 'group' : group . pk , 'user' : request . user . pk } ) return render ( request , template_name , { 'group' : group , 'form' : form } )
returns an invite form .