Add quickfix for Präsenztag FR
This commit is contained in:
parent
5088450f0c
commit
bfa4349658
|
|
@ -825,7 +825,7 @@ def create_uk_fr_circle_fahrzeug(lp, title="Véhicule"):
|
|||
(
|
||||
"document",
|
||||
LearnMediaBlockFactory(
|
||||
title="Überblick Kasko",
|
||||
title="Aperçu casco",
|
||||
description="",
|
||||
icon_url="/static/icons/demo/icon-hf-book.png",
|
||||
link_display_text="Aperçu casco",
|
||||
|
|
|
|||
|
|
@ -110,20 +110,46 @@ def create_or_update_course_session(
|
|||
cs.save()
|
||||
|
||||
for circle in circles:
|
||||
attendance_course_lp_qs = LearningContentAttendanceCourse.objects.filter(
|
||||
slug=f"{course.slug}-lp-circle-{circle.lower()}-lc-präsenzkurs-{circle.lower()}"
|
||||
)
|
||||
if attendance_course_lp_qs.exists():
|
||||
cs.attendance_courses.append(
|
||||
{
|
||||
"learningContentId": attendance_course_lp_qs.first().id,
|
||||
"start": try_parse_datetime(data[f"{circle} Start"])[1].isoformat(),
|
||||
"end": try_parse_datetime(data[f"{circle} Ende"])[1].isoformat(),
|
||||
"location": data[f"{circle} Raum"],
|
||||
"trainer": "",
|
||||
}
|
||||
if language == "de":
|
||||
attendance_course_lp_qs = LearningContentAttendanceCourse.objects.filter(
|
||||
slug=f"{course.slug}-lp-circle-{circle.lower()}-lc-präsenzkurs-{circle.lower()}"
|
||||
)
|
||||
cs.save()
|
||||
if attendance_course_lp_qs.exists():
|
||||
cs.attendance_courses.append(
|
||||
{
|
||||
"learningContentId": attendance_course_lp_qs.first().id,
|
||||
"start": try_parse_datetime(data[f"{circle} Start"])[
|
||||
1
|
||||
].isoformat(),
|
||||
"end": try_parse_datetime(data[f"{circle} Ende"])[
|
||||
1
|
||||
].isoformat(),
|
||||
"location": data[f"{circle} Raum"],
|
||||
"trainer": "",
|
||||
}
|
||||
)
|
||||
cs.save()
|
||||
elif language == "fr":
|
||||
# todo: this is a hack remove me
|
||||
print(f"{course.slug}-lp-circle-véhicule-lc-cours-de-présence-véhicule")
|
||||
attendance_course_lp_qs = LearningContentAttendanceCourse.objects.filter(
|
||||
slug=f"{course.slug}-lp-circle-véhicule-lc-cours-de-présence-véhicule-à-moteur"
|
||||
)
|
||||
if attendance_course_lp_qs.exists():
|
||||
cs.attendance_courses.append(
|
||||
{
|
||||
"learningContentId": attendance_course_lp_qs.first().id,
|
||||
"start": try_parse_datetime(data[f"{circle} Start"])[
|
||||
1
|
||||
].isoformat(),
|
||||
"end": try_parse_datetime(data[f"{circle} Ende"])[
|
||||
1
|
||||
].isoformat(),
|
||||
"location": data[f"{circle} Raum"],
|
||||
"trainer": "",
|
||||
}
|
||||
)
|
||||
cs.save()
|
||||
|
||||
return cs
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue