Example #1
0
 def get_queryset(self, request):
     if is_super(request.user):
         return super(ContactCardAdmin, self).get_queryset(request)
     else:
         roles = Role.edit_applicant_permission_of(request.user)
         qs = ContactCard.objects.filter(position__role__in=roles, )
         ordering = self.get_ordering(request)
         if ordering:
             qs = qs.order_by(*ordering)
         return qs
Example #2
0
 def get_queryset(self, request):
     if is_super(request.user):
         return super(ApplicationAdmin, self).get_queryset(request)
     else:
         roles = Role.edit_applicant_permission_of(request.user)
         qs = Application.objects.filter(
             status__in=['turned_down', 'submitted',
                         'approved', 'disapproved'],
             position__role__in=roles,
         )
         ordering = self.get_ordering(request)
         if ordering:
             qs = qs.order_by(*ordering)
         return qs