From 053225c6dc813af4d67309f687c7c3e43a9f519a Mon Sep 17 00:00:00 2001 From: korenstin Date: Sun, 25 Aug 2024 15:13:02 +0200 Subject: [PATCH] revert sort tables to member views --- apps/member/views.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/member/views.py b/apps/member/views.py index 748e8b1a..348bf089 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -166,8 +166,7 @@ class UserDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): # Display only the most recent membership club_list = club_list.distinct("club__name")\ if settings.DATABASES["default"]["ENGINE"] == 'django.db.backends.postgresql' else club_list - club_list_order_by = self.request.GET.getlist("membership-sort", ("club__name", "-date_start")) - membership_table = MembershipTable(data=club_list, prefix='membership-', order_by=club_list_order_by) + membership_table = MembershipTable(data=club_list, prefix='membership-') membership_table.paginate(per_page=10, page=self.request.GET.get("membership-page", 1)) context['club_list'] = membership_table @@ -477,8 +476,7 @@ class ClubDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): managers = Membership.objects.filter(club=self.object, roles__name="Bureau de club", date_start__lte=date.today(), date_end__gte=date.today())\ .order_by('user__last_name').all() - managers_order_by = self.request.GET.getlist("managers-sort", ('user__last_name')) - context["managers"] = ClubManagerTable(data=managers, prefix="managers-", order_by=managers_order_by) + context["managers"] = ClubManagerTable(data=managers, prefix="managers-") # transaction history club_transactions = Transaction.objects.all().filter(Q(source=club.note) | Q(destination=club.note))\ .filter(PermissionBackend.filter_queryset(self.request, Transaction, "view"))\ @@ -496,8 +494,7 @@ class ClubDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): club_member = club_member.distinct("user__username")\ if settings.DATABASES["default"]["ENGINE"] == 'django.db.backends.postgresql' else club_member - membership_order_by = self.request.GET.getlist("membership-sort", ("user__username", "-date_start")) - membership_table = MembershipTable(data=club_member, prefix="membership-", order_by=membership_order_by) + membership_table = MembershipTable(data=club_member, prefix="membership-") membership_table.paginate(per_page=5, page=self.request.GET.get('membership-page', 1)) context['member_list'] = membership_table