Skip to content
Snippets Groups Projects
Commit 97f20ff0 authored by Pinguin's avatar Pinguin :penguin:
Browse files

Delete the update() method from AutomaticPlan

parent 6d272e34
No related branches found
No related tags found
1 merge request!252Resolve "Drop update() from AutomaticPlan"
Pipeline #64368 canceled
......@@ -13,7 +13,7 @@ Changed
~~~~~~~
* Change the icon set to iconify.
* Remove the update() method in AutomaticPlan.
`2.3`_ - 2022-03-21
-------------------
......
......@@ -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")
......
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