Coverage for apps/users/mixins.py: 86%
10 statements
« prev ^ index » next coverage.py v6.4.4, created at 2023-09-12 11:58 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2023-09-12 11:58 -0600
1from apps.users.permissions import AdminPanel
4class AdminMixin:
5 permission_classes = [AdminPanel]
7 @property
8 def model(self):
9 """
10 Retrieve model used in serializer
11 """
12 return self.serializer_class.Meta.model
14 def get_queryset(self):
15 """
16 Get Only Organization Related objects
17 """
18 if self.queryset: 18 ↛ 19line 18 didn't jump to line 19, because the condition on line 18 was never true
19 return self.queryset
20 return self.model.objects.all()