1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-22 23:42:25 +00:00

Superusers can see their note even if they have no membership for local dev

This commit is contained in:
Yohann D'ANELLO 2020-08-20 23:13:27 +02:00
parent a1dc8fe530
commit c090b4af76

View File

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