mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-12-22 15:32:22 +00:00
🐛 Minor fixes
This commit is contained in:
parent
b2e1777fe0
commit
f0bca69825
@ -303,7 +303,7 @@ class ClubListView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableView):
|
||||
"""
|
||||
Filter the user list with the given pattern.
|
||||
"""
|
||||
qs = super().get_queryset().filter()
|
||||
qs = super().get_queryset().distinct()
|
||||
if "search" in self.request.GET:
|
||||
pattern = self.request.GET["search"]
|
||||
|
||||
|
@ -164,7 +164,7 @@ class FutureUserListView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableVi
|
||||
:param kwargs:
|
||||
:return:
|
||||
"""
|
||||
qs = super().get_queryset().filter(profile__registration_valid=False)
|
||||
qs = super().get_queryset().distinct().filter(profile__registration_valid=False)
|
||||
if "search" in self.request.GET:
|
||||
pattern = self.request.GET["search"]
|
||||
|
||||
|
@ -96,7 +96,7 @@ class WEIMembershipForm(forms.ModelForm):
|
||||
class BusForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Bus
|
||||
fields = '__all__'
|
||||
exclude = ('information_json',)
|
||||
widgets = {
|
||||
"wei": Autocomplete(
|
||||
WEIClub,
|
||||
|
@ -113,6 +113,7 @@ class BusTeam(models.Model):
|
||||
|
||||
name = models.CharField(
|
||||
max_length=255,
|
||||
verbose_name=_("name"),
|
||||
)
|
||||
|
||||
color = models.PositiveIntegerField( # Use a color picker to get the hexa code
|
||||
|
@ -144,7 +144,7 @@ class BusTable(tables.Table):
|
||||
)
|
||||
|
||||
def render_teams(self, value):
|
||||
return ", ".join(team.name for team in value.all())
|
||||
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")))
|
||||
|
@ -330,7 +330,7 @@ class BusManageView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView):
|
||||
|
||||
bus = self.object
|
||||
teams = BusTeam.objects.filter(PermissionBackend.filter_queryset(self.request.user, BusTeam, "view")) \
|
||||
.filter(bus=bus).annotate(count=Count("memberships"))
|
||||
.filter(bus=bus).annotate(count=Count("memberships")).order_by("name")
|
||||
teams_table = BusTeamTable(data=teams, prefix="team-")
|
||||
context["teams"] = teams_table
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
\usepackage[french]{babel}
|
||||
|
||||
\usepackage[margin=1.5cm]{geometry}
|
||||
\usepackage{lmodern}
|
||||
\usepackage{ltablex}
|
||||
\usepackage{tabularx}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user