diff --git a/codeforlife/user/views/klass.py b/codeforlife/user/views/klass.py index bc863e88..72bb94d8 100644 --- a/codeforlife/user/views/klass.py +++ b/codeforlife/user/views/klass.py @@ -2,7 +2,7 @@ from rest_framework.viewsets import ModelViewSet from ..models import Class, User -from ..permissions import IsSchoolMember +from ..permissions import InSchool from ..serializers import ClassSerializer @@ -10,7 +10,7 @@ class ClassViewSet(ModelViewSet): http_method_names = ["get"] lookup_field = "access_code" serializer_class = ClassSerializer - permission_classes = [IsAuthenticated, IsSchoolMember] + permission_classes = [IsAuthenticated, InSchool] def get_queryset(self): user: User = self.request.user diff --git a/codeforlife/user/views/school.py b/codeforlife/user/views/school.py index 0c12d9cd..dd620d78 100644 --- a/codeforlife/user/views/school.py +++ b/codeforlife/user/views/school.py @@ -2,14 +2,14 @@ from rest_framework.viewsets import ModelViewSet from ..models import School, User -from ..permissions import IsSchoolMember +from ..permissions import InSchool from ..serializers import SchoolSerializer class SchoolViewSet(ModelViewSet): http_method_names = ["get"] serializer_class = SchoolSerializer - permission_classes = [IsAuthenticated, IsSchoolMember] + permission_classes = [IsAuthenticated, InSchool] def get_queryset(self): user: User = self.request.user