diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 35f89f7f1ea2855eff7b590a401ea7aae50cf481..5259e9a04ecf8c1636adcef29d39da5d8d38bcfb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,7 +13,7 @@ Changed ~~~~~~~ * Change the icon set to iconify. - +* Remove the update() method in AutomaticPlan. `2.3`_ - 2022-03-21 ------------------- diff --git a/aleksis/apps/chronos/models.py b/aleksis/apps/chronos/models.py index 5e2690b5cf54d2e1d53e328932b74720783c4536..04148bf372cface1644d7e899db7d8fc061ab88a 100644 --- a/aleksis/apps/chronos/models.py +++ b/aleksis/apps/chronos/models.py @@ -1249,6 +1249,8 @@ class ExtraLesson( class AutomaticPlan(LiveDocument): """Model for configuring automatically updated PDF substitution plans.""" + template = "chronos/substitutions_print.html" + number_of_days = models.PositiveIntegerField( default=1, validators=[MinValueValidator(1)], @@ -1324,19 +1326,6 @@ class AutomaticPlan(LiveDocument): self.last_substitutions_revision = revision self.save() - def update(self, triggered_manually: bool = True): - """Regenerate the PDF file with the substitutions plan.""" - file_object, result = generate_pdf_from_template( - "chronos/substitutions_print.html", self.get_context_data() - ) - with allow_join_result(): - result.wait() - file_object.refresh_from_db() - if result.status == SUCCESS and file_object.file: - self.last_update_triggered_manually = triggered_manually - self.current_file.save(self.filename, file_object.file.file) - self.save() - class Meta: verbose_name = _("Automatic plan") verbose_name_plural = _("Automatic plans")