proper filenames for originals and archived documents

This commit is contained in:
Jonas Winkler
2020-11-25 18:01:29 +01:00
parent 64180b5668
commit 17a581495c
2 changed files with 7 additions and 1 deletions

View File

@@ -241,6 +241,10 @@ class Document(models.Model):
def file_name(self):
return slugify(str(self)) + self.file_type
@property
def archive_file_name(self):
return slugify(str(self)) + ".pdf"
@property
def file_type(self):
return mimetypes.guess_extension(str(self.mime_type))