Skip to content
Snippets Groups Projects
Verified Commit 43f115f5 authored by magicfelix's avatar magicfelix
Browse files

Add week documentation preference and carry over for CourseBook

parent df744e42
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,16 @@ class AllowCarryOverLessonDocumentationToCurrentWeek(BooleanPreference):
)
@site_preferences_registry.register
class DocumentLessonTopicsByWeek(BooleanPreference):
section = alsijil
name = "document_lesson_topics_by_week"
default = False
verbose_name = _(
"Document lesson topics per week instead of per lesson period"
)
@site_preferences_registry.register
class CarryOverPersonalNotesToNextPeriods(BooleanPreference):
section = alsijil
......
......@@ -5,6 +5,7 @@ from graphene_django import DjangoObjectType
from aleksis.apps.chronos.models import Lesson
from aleksis.core.models import Group, Person
from aleksis.core.util.core_helpers import get_site_preferences
from .models import (
Event,
......@@ -112,6 +113,19 @@ class LessonDocumentationMutation(graphene.Mutation):
lesson_documentation.save()
if (
get_site_preferences()["alsijil__document_lesson_topics_by_week"]
and (
lesson_documentation.topic
or lesson_documentation.homework
or lesson_documentation.group_note
)
and lesson_documentation.lesson_period
):
lesson_documentation.carry_over_data(
LessonPeriod.objects.filter(lesson=lesson_documentation.lesson_period.lesson)
)
return LessonDocumentationMutation(lesson_documentation=lesson_documentation)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment