from django.db.models import Q
def get_queryset(self, request):
qs = super(CandidateAdmin, self).get_queryset(request)
group_names = self.get_group_names(request.user)
if request.user.is_superuser or 'hr' in group_names:
return qs
return Candidate.objects.filter(
Q(first_interviewer_user=request.user) | Q(second_interviewer_user=request.user))