feat: update init users

This commit is contained in:
2026-06-13 13:21:53 +08:00
parent 05ce7e987e
commit 46761906fe
11 changed files with 502 additions and 430 deletions
+2 -2
View File
@@ -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)