Skip to content
Snippets Groups Projects
Verified Commit d8f774a7 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Remove storage-specific source code from automatic plan system

parent 58cfaaa0
No related tags found
1 merge request!191Resolve "Automatically create a PDF file of the substitution plan"
......@@ -1229,27 +1229,6 @@ class AutomaticPlan(ExtensibleModel):
"""Get filename (without path) of the PDF file."""
return f"{self.slug}.pdf"
@property
def path(self) -> str:
"""Get the relative path of the PDF file in the media directory."""
return os.path.join("chronos", "plans", self.filename)
@property
def local_path(self) -> str:
"""Get the full path under which the PDF file can accessed on the local system."""
try:
return default_storage.path(self.path)
except NotImplementedError:
return self.path
def save(self, *args, **kwargs):
super().save(*args, **kwargs)
if self.current_file:
if default_storage.exists(self.path):
default_storage.delete(self.path)
default_storage.save(self.path, self.current_file.file)
class Meta:
verbose_name = _("Automatic plan")
verbose_name_plural = _("Automatic plans")
......
......@@ -52,7 +52,6 @@ class AutomaticPlanTable(tables.Table):
name = tables.LinkColumn("edit_automatic_plan", args=[A("id")])
filename = tables.LinkColumn("show_automatic_plan", args=[A("slug")])
local_path = tables.Column()
last_update = tables.DateTimeColumn()
last_update_triggered_manually = tables.BooleanColumn()
edit = tables.LinkColumn(
......
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