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", "")