You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
403 B
12 lines
403 B
from progress.models import ProgressLesson, Progress
|
|
|
|
|
|
def add_lesson(user_out_key: str, course_token: str, lesson_token: str, teacher_key: str, is_hm: bool):
|
|
|
|
p = Progress.objects.get(course_token=course_token, user__out_key=user_out_key)
|
|
|
|
ProgressLesson.objects.get_or_create(
|
|
progress=p,
|
|
lesson_token=lesson_token,
|
|
checker=user_out_key if is_hm else teacher_key,
|
|
) |