From d6661790377ae441c798bbe88d99026ddf569f56 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sun, 4 Oct 2020 20:50:10 +0200 Subject: [PATCH] Display Renew membership button 15 days more --- apps/member/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/member/views.py b/apps/member/views.py index 5cce34f5..90dba96b 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -157,7 +157,7 @@ class UserDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): history_table.paginate(per_page=20, page=self.request.GET.get("transaction-page", 1)) context['history_list'] = history_table - club_list = Membership.objects.filter(user=user, date_end__gte=date.today())\ + club_list = Membership.objects.filter(user=user, date_end__gte=date.today() - timedelta(days=15))\ .filter(PermissionBackend.filter_queryset(self.request.user, Membership, "view")) membership_table = MembershipTable(data=club_list, prefix='membership-') membership_table.paginate(per_page=10, page=self.request.GET.get("membership-page", 1)) @@ -409,7 +409,7 @@ class ClubDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): # member list club_member = Membership.objects.filter( club=club, - date_end__gte=date.today(), + date_end__gte=date.today() - timedelta(days=15), ).filter(PermissionBackend.filter_queryset(self.request.user, Membership, "view")) membership_table = MembershipTable(data=club_member, prefix="membership-")