From a41e51e23ad66e45e2d88fc1290e9abdd54dcb55 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Wed, 25 Mar 2020 17:42:54 +0100 Subject: [PATCH] add member get side information --- apps/member/views.py | 4 ++-- templates/member/add_members.html | 12 ++++++++---- templates/member/club_info.html | 6 +++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/member/views.py b/apps/member/views.py index b518ad24..14322dcf 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -391,12 +391,12 @@ class ClubAddMemberView(LoginRequiredMixin, CreateView): return super().get_queryset().filter(PermissionBackend.filter_queryset(self.request.user, Membership, "view") | PermissionBackend.filter_queryset(self.request.user, Membership, "change")) - def get_context_data(self, **kwargs): + club = Club.objects.get(pk=self.kwargs["pk"]) context = super().get_context_data(**kwargs) context['formset'] = MemberFormSet() context['helper'] = FormSetHelper() - + context['club'] = club context['no_cache'] = True return context diff --git a/templates/member/add_members.html b/templates/member/add_members.html index 8032af30..8b57e7d4 100644 --- a/templates/member/add_members.html +++ b/templates/member/add_members.html @@ -1,7 +1,11 @@ -{% extends "base.html" %} +{% extends "member/noteowner_detail.html" %} {% load crispy_forms_tags %} {% load static %} -{% block content %} + +{% block profile_info %} +{% include "member/club_info.html" %} +{% endblock %} +{% block profile_content %}
{% csrf_token %} @@ -10,9 +14,9 @@
+{% endblock %} - - +{% block extrajavascript %}