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
1 changed files with 4 additions and 1 deletions

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