Skip to content
Snippets Groups Projects
Verified Commit 7dbb434e authored by Lloyd Meins's avatar Lloyd Meins :thought_balloon:
Browse files

Prevent method from calling itself through other lessons

parent 80ff7052
No related branches found
No related tags found
1 merge request!169Resolve "Lesson topic not carried to previous lesson if entered in second lesson of a block"
......@@ -309,16 +309,17 @@ class LessonDocumentation(RegisterObjectRelatedMixin, ExtensibleModel):
changed = True
if changed:
lesson_documentation.save()
lesson_documentation.save(carry_over=False)
def __str__(self) -> str:
return f"{self.lesson_period}, {self.date_formatted}"
def save(self, *args, **kwargs):
def save(self, carry_over=True, *args, **kwargs):
if (
get_site_preferences()["alsijil__carry_over"]
and (self.topic or self.homework or self.group_note)
and self.lesson_period
and carry_over
):
self._carry_over_data()
super().save(*args, **kwargs)
......
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