mirror of https://gitlab.crans.org/bde/nk20
🐛 Display full registration table when the search bar is empty
This commit is contained in:
parent
94086505e6
commit
f8a4087e56
|
@ -179,8 +179,6 @@ class FutureUserListView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTableVi
|
||||||
| Q(profile__section__iregex=pattern)
|
| Q(profile__section__iregex=pattern)
|
||||||
| Q(username__iregex="^" + pattern)
|
| Q(username__iregex="^" + pattern)
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
qs = qs.none()
|
|
||||||
|
|
||||||
return qs[:20]
|
return qs[:20]
|
||||||
|
|
||||||
|
|
|
@ -236,14 +236,12 @@ class WEIRegistrationsView(ProtectQuerysetMixin, LoginRequiredMixin, SingleTable
|
||||||
pattern = self.request.GET.get("search", "")
|
pattern = self.request.GET.get("search", "")
|
||||||
|
|
||||||
if not pattern:
|
if not pattern:
|
||||||
return qs.none()
|
qs = qs.filter(
|
||||||
|
Q(user__first_name__iregex=pattern)
|
||||||
qs = qs.filter(
|
| Q(user__last_name__iregex=pattern)
|
||||||
Q(user__first_name__iregex=pattern)
|
| Q(user__note__alias__name__iregex="^" + pattern)
|
||||||
| Q(user__last_name__iregex=pattern)
|
| Q(user__note__alias__normalized_name__iregex="^" + Alias.normalize(pattern))
|
||||||
| Q(user__note__alias__name__iregex="^" + pattern)
|
)
|
||||||
| Q(user__note__alias__normalized_name__iregex="^" + Alias.normalize(pattern))
|
|
||||||
)
|
|
||||||
|
|
||||||
return qs[:20]
|
return qs[:20]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue