feat: update init users
This commit is contained in:
+2
-2
@@ -67,8 +67,8 @@ class UserViewSet(viewsets.ModelViewSet):
|
||||
if self.action == 'list':
|
||||
if user.role_type in ('super_admin', 'content_admin') or user.is_staff:
|
||||
return qs # 管理员:全员
|
||||
elif user.role_type == 'teacher':
|
||||
# 教师:仅自己名下活跃学生
|
||||
elif user.role_type == 'doctor':
|
||||
# 带教医生:仅自己名下活跃学生
|
||||
student_ids = TeacherStudentRelation.objects.filter(
|
||||
teacher=user, status=1
|
||||
).values_list('student_id', flat=True)
|
||||
|
||||
Reference in New Issue
Block a user