| Total Complexity | 2 |
| Total Lines | 10 |
| Duplicated Lines | 0 % |
| 1 | from django.http import Http404 |
||
| 12 | class SchoolViewSet(viewsets.ModelViewSet): |
||
| 13 | queryset = School.objects.all() |
||
| 14 | serializer_class = SchoolSerializer |
||
| 15 | permission_classes = [IsAuthenticated, DRYPermissions, ] |
||
| 16 | |||
| 17 | def get_permissions(self): |
||
| 18 | if self.action == 'list': |
||
| 19 | self.permission_classes = [AllowAny, ] |
||
| 20 | |||
| 21 | return super(SchoolViewSet, self).get_permissions() |
||
| 22 |