mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-21 10:29:29 -05:00
removed some obsolete fields from the document model
This commit is contained in:
parent
f8f100781e
commit
9e4147ac52
@ -208,13 +208,8 @@ class Document(models.Model):
|
|||||||
def file_name(self):
|
def file_name(self):
|
||||||
return slugify(str(self)) + "." + self.file_type
|
return slugify(str(self)) + "." + self.file_type
|
||||||
|
|
||||||
@property
|
|
||||||
def download_url(self):
|
|
||||||
return reverse("fetch", kwargs={"kind": "doc", "pk": self.pk})
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def thumbnail_path(self):
|
def thumbnail_path(self):
|
||||||
|
|
||||||
file_name = "{:07}.png".format(self.pk)
|
file_name = "{:07}.png".format(self.pk)
|
||||||
if self.storage_type == self.STORAGE_TYPE_GPG:
|
if self.storage_type == self.STORAGE_TYPE_GPG:
|
||||||
file_name += ".gpg"
|
file_name += ".gpg"
|
||||||
@ -228,10 +223,6 @@ class Document(models.Model):
|
|||||||
def thumbnail_file(self):
|
def thumbnail_file(self):
|
||||||
return open(self.thumbnail_path, "rb")
|
return open(self.thumbnail_path, "rb")
|
||||||
|
|
||||||
@property
|
|
||||||
def thumbnail_url(self):
|
|
||||||
return reverse("fetch", kwargs={"kind": "thumb", "pk": self.pk})
|
|
||||||
|
|
||||||
|
|
||||||
class Log(models.Model):
|
class Log(models.Model):
|
||||||
|
|
||||||
|
@ -65,8 +65,8 @@ def run_post_consume_script(sender, document, **kwargs):
|
|||||||
document.file_name,
|
document.file_name,
|
||||||
document.source_path,
|
document.source_path,
|
||||||
document.thumbnail_path,
|
document.thumbnail_path,
|
||||||
document.download_url,
|
None,
|
||||||
document.thumbnail_url,
|
None,
|
||||||
str(document.correspondent),
|
str(document.correspondent),
|
||||||
str(",".join(document.tags.all().values_list("slug", flat=True)))
|
str(",".join(document.tags.all().values_list("slug", flat=True)))
|
||||||
)).wait()
|
)).wait()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user