removed some obsolete fields from the document model

This commit is contained in:
Jonas Winkler 2020-10-28 01:41:18 +01:00
parent f8f100781e
commit 9e4147ac52
2 changed files with 2 additions and 11 deletions

View File

@ -208,13 +208,8 @@ class Document(models.Model):
def file_name(self):
return slugify(str(self)) + "." + self.file_type
@property
def download_url(self):
return reverse("fetch", kwargs={"kind": "doc", "pk": self.pk})
@property
def thumbnail_path(self):
file_name = "{:07}.png".format(self.pk)
if self.storage_type == self.STORAGE_TYPE_GPG:
file_name += ".gpg"
@ -228,10 +223,6 @@ class Document(models.Model):
def thumbnail_file(self):
return open(self.thumbnail_path, "rb")
@property
def thumbnail_url(self):
return reverse("fetch", kwargs={"kind": "thumb", "pk": self.pk})
class Log(models.Model):

View File

@ -65,8 +65,8 @@ def run_post_consume_script(sender, document, **kwargs):
document.file_name,
document.source_path,
document.thumbnail_path,
document.download_url,
document.thumbnail_url,
None,
None,
str(document.correspondent),
str(",".join(document.tags.all().values_list("slug", flat=True)))
)).wait()