From 9864ed5fc78dd1a45acbc936f184843a3901911e Mon Sep 17 00:00:00 2001 From: SKairinos Date: Tue, 12 Dec 2023 18:05:38 +0000 Subject: [PATCH] replace permissions --- codeforlife/user/views/klass.py | 4 ++-- codeforlife/user/views/school.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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