From 18bdc8044bfa396f5ce00e46e4a1109f9710e1b0 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 25 Jul 2020 18:26:18 +0200 Subject: [PATCH] :bug: Minor fixes --- apps/wei/tables.py | 4 ++-- apps/wei/views.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/wei/tables.py b/apps/wei/tables.py index e4d09fec..a6bc25c6 100644 --- a/apps/wei/tables.py +++ b/apps/wei/tables.py @@ -147,7 +147,7 @@ class BusTable(tables.Table): return ", ".join(team.name for team in value.order_by('name').all()) def render_count(self, value): - return str(value) + " " + (str(_("members")) if value > 0 else str(_("member"))) + return str(value) + " " + (str(_("members")) if value > 1 else str(_("member"))) class Meta: attrs = { @@ -178,7 +178,7 @@ class BusTeamTable(tables.Table): ) def render_count(self, value): - return str(value) + " " + (str(_("members")) if value > 0 else str(_("member"))) + return str(value) + " " + (str(_("members")) if value > 1 else str(_("member"))) count = tables.Column( verbose_name=_("Members count"), diff --git a/apps/wei/views.py b/apps/wei/views.py index 76a01fae..3accb804 100644 --- a/apps/wei/views.py +++ b/apps/wei/views.py @@ -177,7 +177,7 @@ class WEIMembershipsView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableVi return super().dispatch(request, *args, **kwargs) def get_queryset(self, **kwargs): - qs = super().get_queryset(**kwargs).filter(club=self.club) + qs = super().get_queryset(**kwargs).filter(club=self.club).distinct() pattern = self.request.GET.get("search", "") @@ -214,7 +214,7 @@ class WEIRegistrationsView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTable return super().dispatch(request, *args, **kwargs) def get_queryset(self, **kwargs): - qs = super().get_queryset(**kwargs).filter(wei=self.club, membership=None) + qs = super().get_queryset(**kwargs).filter(wei=self.club, membership=None).distinct() pattern = self.request.GET.get("search", "")