Skip to content
Snippets Groups Projects
Commit 672baf26 authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Only check carry over form field if the corresponding preference is turned on

parent 0552868d
No related branches found
No related tags found
1 merge request!286Resolve "KeyError: 'carry_over_week' if preference is disabled"
Pipeline #74393 passed
......@@ -22,6 +22,7 @@ Fixed
* The week overview page was not refreshed when a new week was selected in the dropdown.
* Make generation of full register printout faster.
* Updating a lesson documentation caused an error when the preference for carrying over lesson documentations to the whole week was deactivated.
`2.0.1`_ - 2022-02-12
---------------------
......
......@@ -58,7 +58,8 @@ class LessonDocumentationForm(forms.ModelForm):
def save(self, **kwargs):
lesson_documentation = super(LessonDocumentationForm, self).save(commit=True)
if (
self.cleaned_data["carry_over_week"]
get_site_preferences()["alsijil__allow_carry_over_same_week"]
and self.cleaned_data["carry_over_week"]
and (
lesson_documentation.topic
or lesson_documentation.homework
......
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