fix: create_laerning_mentor for vv course

This commit is contained in:
Livio Bieri 2024-02-12 15:27:43 +01:00
parent 8008af0777
commit a97e698165
1 changed files with 14 additions and 6 deletions

View File

@ -9,12 +9,16 @@ from vbv_lernwelt.core.constants import (
TEST_COURSE_SESSION_BERN_ID,
TEST_MENTOR1_USER_ID,
TEST_STUDENT1_USER_ID,
TEST_STUDENT1_VV_USER_ID,
TEST_STUDENT2_USER_ID,
TEST_STUDENT3_USER_ID,
TEST_TRAINER1_USER_ID,
)
from vbv_lernwelt.core.models import Organisation, User
from vbv_lernwelt.course.consts import COURSE_TEST_ID
from vbv_lernwelt.course.consts import (
COURSE_TEST_ID,
COURSE_VERSICHERUNGSVERMITTLERIN_ID,
)
from vbv_lernwelt.course.creators.test_course import (
create_edoniq_test_result_data,
create_feedback_response_data,
@ -332,15 +336,19 @@ def command(
attendance_course.save()
if create_learning_mentor:
mentor = LearningMentor.objects.create(
course=Course.objects.get(id=COURSE_TEST_ID),
vv_course = Course.objects.get(id=COURSE_VERSICHERUNGSVERMITTLERIN_ID)
vv_course_session = CourseSession.objects.get(course=vv_course)
vv_mentor = LearningMentor.objects.create(
course=vv_course,
mentor=User.objects.get(id=TEST_MENTOR1_USER_ID),
)
course_session = CourseSession.objects.get(id=TEST_COURSE_SESSION_BERN_ID)
csu = CourseSessionUser.objects.get(
user__id=TEST_STUDENT1_USER_ID, course_session=course_session
user__id=TEST_STUDENT1_VV_USER_ID, course_session=vv_course_session
)
mentor.participants.add(csu)
vv_mentor.participants.add(csu)
course = Course.objects.get(id=COURSE_TEST_ID)
course.enable_circle_documents = enable_circle_documents