chore: expose create_learning_mentor to django admin
This commit is contained in:
parent
0e5e311829
commit
c5197c6c70
|
|
@ -13,7 +13,7 @@ from vbv_lernwelt.core.constants import (
|
|||
TEST_STUDENT3_USER_ID,
|
||||
TEST_TRAINER1_USER_ID,
|
||||
)
|
||||
from vbv_lernwelt.core.models import User
|
||||
from vbv_lernwelt.core.models import User, Organisation
|
||||
from vbv_lernwelt.course.consts import COURSE_TEST_ID
|
||||
from vbv_lernwelt.course.creators.test_course import (
|
||||
create_edoniq_test_result_data,
|
||||
|
|
@ -108,6 +108,7 @@ def command(
|
|||
CourseSessionAttendanceCourse.objects.all().update(attendance_user_list=[])
|
||||
|
||||
LearningMentor.objects.all().delete()
|
||||
User.objects.all().update(organisation=Organisation.objects.first())
|
||||
User.objects.all().update(language="de")
|
||||
User.objects.all().update(additional_json_data={})
|
||||
|
||||
|
|
@ -331,7 +332,6 @@ def command(
|
|||
attendance_course.save()
|
||||
|
||||
if create_learning_mentor:
|
||||
print("Create learning mentor")
|
||||
mentor = LearningMentor.objects.create(
|
||||
course=Course.objects.get(id=COURSE_TEST_ID),
|
||||
mentor=User.objects.get(id=TEST_MENTOR1_USER_ID),
|
||||
|
|
|
|||
|
|
@ -167,6 +167,10 @@ def cypress_reset_view(request):
|
|||
request.data.get("create_attendance_days") == "true"
|
||||
)
|
||||
|
||||
options["create_learning_mentor"] = (
|
||||
request.data.get("create_learning_mentor") == "true"
|
||||
)
|
||||
|
||||
call_command(
|
||||
"cypress_reset",
|
||||
**options,
|
||||
|
|
|
|||
|
|
@ -47,6 +47,12 @@
|
|||
|
||||
<form action="/api/core/cypressreset/" method="post">
|
||||
{% csrf_token %}
|
||||
<label>
|
||||
<input type="checkbox" name="create_learning_mentor" value="true">
|
||||
create_learning_mentor
|
||||
</label>
|
||||
<div style="margin-bottom: 8px; padding: 4px; border-bottom: 1px lightblue solid"></div>
|
||||
|
||||
<label>
|
||||
<input type="checkbox" name="create_assignment_completion" value="true">
|
||||
create_assignment_completion
|
||||
|
|
|
|||
Loading…
Reference in New Issue