Coverage for server / routes / teacher / teacher_students.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-10-04 09:33 +0000

1from fastapi import APIRouter, Body, status, UploadFile, File, Depends, HTTPException 

2from server.authentication.auth0_bearer import Auth0Bearer 

3 

4router = APIRouter() 

5 

6 

7@router.post( 

8 "/create", 

9 dependencies=[Depends(Auth0Bearer(access_levels=["teacher"]))], 

10 status_code=status.HTTP_410_GONE, 

11 deprecated=True, 

12 response_description="Endpoint deprecated", 

13 description="DEPRECATED: Student creation moved to Staff-Admin API (port 8002) at POST /v1/staff/students/create", 

14 summary="[DEPRECATED] Student creation moved to Staff-Admin API.", 

15 responses={ 

16 410: { 

17 "description": "Endpoint deprecated", 

18 "content": { 

19 "application/json": { 

20 "example": { 

21 "detail": "Student creation moved to POST /v1/staff/students/create on the Staff-Admin API." 

22 } 

23 } 

24 }, 

25 } 

26 }, 

27) 

28async def create(account: dict = Body(...)) -> dict: 

29 raise HTTPException( 

30 status_code=status.HTTP_410_GONE, 

31 detail="Student creation moved to POST /v1/staff/students/create on the Staff-Admin API.", 

32 ) 

33 

34 

35@router.post( 

36 "/bulk/create", 

37 dependencies=[Depends(Auth0Bearer(access_levels=["teacher"]))], 

38 status_code=status.HTTP_410_GONE, 

39 deprecated=True, 

40 response_description="Endpoint deprecated", 

41 description="DEPRECATED: Bulk student creation moved to Staff-Admin API (port 8002) at POST /v1/staff/students/bulk/create", 

42 summary="[DEPRECATED] Bulk student creation moved to Staff-Admin API.", 

43 responses={ 

44 410: { 

45 "description": "Endpoint deprecated", 

46 "content": { 

47 "application/json": { 

48 "example": { 

49 "detail": "Bulk student creation moved to POST /v1/staff/students/bulk/create on the Staff-Admin API." 

50 } 

51 } 

52 }, 

53 } 

54 }, 

55) 

56async def bulk_create(file: UploadFile = File(...)): 

57 raise HTTPException( 

58 status_code=status.HTTP_410_GONE, 

59 detail="Bulk student creation moved to POST /v1/staff/students/bulk/create on the Staff-Admin API.", 

60 )