diff --git a/backend/api/tests/test_admin.py b/backend/api/tests/test_admin.py index 5de600b2..00362f86 100644 --- a/backend/api/tests/test_admin.py +++ b/backend/api/tests/test_admin.py @@ -8,7 +8,7 @@ def create_faculty(name): """ Create a Faculty with the given arguments.""" - return Faculty.objects.create(name=name) + return Faculty.objects.create(id=name,name=name) def create_admin(id, first_name, last_name, email, faculty=None): diff --git a/backend/api/tests/test_assistant.py b/backend/api/tests/test_assistant.py index b59ab048..c20d4e9a 100644 --- a/backend/api/tests/test_assistant.py +++ b/backend/api/tests/test_assistant.py @@ -22,7 +22,7 @@ def create_course(name, academic_startyear, description=None, parent_course=None def create_faculty(name): """Create a Faculty with the given arguments.""" - return Faculty.objects.create(name=name) + return Faculty.objects.create(id=name,name=name) def create_assistant(id, first_name, last_name, email, faculty=None, courses=None): diff --git a/backend/api/tests/test_student.py b/backend/api/tests/test_student.py index 1fced767..de242070 100644 --- a/backend/api/tests/test_student.py +++ b/backend/api/tests/test_student.py @@ -21,7 +21,7 @@ def create_course(name, academic_startyear, description=None, parent_course=None def create_faculty(name): """Create a Faculty with the given arguments.""" - return Faculty.objects.create(name=name) + return Faculty.objects.create(id=name,name=name) def create_student(id, first_name, last_name, email, faculty=None, courses=None): diff --git a/backend/api/tests/test_teacher.py b/backend/api/tests/test_teacher.py index ec58ec95..456128cc 100644 --- a/backend/api/tests/test_teacher.py +++ b/backend/api/tests/test_teacher.py @@ -21,7 +21,7 @@ def create_course(name, academic_startyear, description=None, parent_course=None def create_faculty(name): """Create a Faculty with the given arguments.""" - return Faculty.objects.create(name=name) + return Faculty.objects.create(id=name,name=name) def create_teacher(id, first_name, last_name, email, faculty=None, courses=None): diff --git a/backend/api/views/course_view.py b/backend/api/views/course_view.py index 5c64b9c1..370b1ee1 100644 --- a/backend/api/views/course_view.py +++ b/backend/api/views/course_view.py @@ -29,7 +29,6 @@ class CourseViewSet(viewsets.ModelViewSet): """Actions for general course logic""" queryset = Course.objects.all() serializer_class = CourseSerializer - pagination_class = BasicPagination permission_classes = [IsAdminUser | CoursePermission] def create(self, request: Request, *_): @@ -50,6 +49,8 @@ def create(self, request: Request, *_): @action(detail=False) def search(self, request: Request) -> Response: + self.pagination_class = BasicPagination + # Extract filter params search = request.query_params.get("search", "") years = request.query_params.getlist("years[]")