1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-27 20:22:15 +02:00

100% coverage on registration app

This commit is contained in:
Yohann D'ANELLO
2020-09-03 20:03:40 +02:00
parent 4b85a35a9d
commit f02efd3b39
5 changed files with 401 additions and 20 deletions

View File

@ -140,9 +140,7 @@ class UserDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView):
"""
We can't display information of a not registered user.
"""
qs = super().get_queryset()
return qs if self.request.user.is_superuser and self.request.session.get("permission_mask", -1) >= 42\
else qs.filter(profile__registration_valid=True)
return super().get_queryset().filter(profile__registration_valid=True)
def get_context_data(self, **kwargs):
"""