mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-01 18:37:42 -05:00
Fixed a few consumer bugs and added an exporter
Rename exporter to export and fixt some debugging Account for files not matching the sender/title pattern Added a safety note Wrong regex on the name parser Renamed the command to something slightly less ambiguous
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import gnupg
|
||||
|
||||
from django.conf import settings
|
||||
from django.http import HttpResponse
|
||||
from django.template.defaultfilters import slugify
|
||||
from django.views.generic.detail import DetailView
|
||||
|
||||
from paperless.db import GnuPG
|
||||
|
||||
from .models import Document
|
||||
|
||||
|
||||
@@ -17,12 +16,8 @@ class PdfView(DetailView):
|
||||
Override the default to return the unencrypted PDF as raw data.
|
||||
"""
|
||||
|
||||
gpg = gnupg.GPG(gnupghome=settings.GNUPG_HOME)
|
||||
|
||||
response = HttpResponse(gpg.decrypt_file(
|
||||
self.object.pdf,
|
||||
passphrase=settings.PASSPHRASE,
|
||||
).data, content_type="application/pdf")
|
||||
response = HttpResponse(
|
||||
GnuPG.decrypted(self.object.pdf), content_type="application/pdf")
|
||||
response["Content-Disposition"] = 'attachment; filename="{}"'.format(
|
||||
slugify(str(self.object)) + ".pdf")
|
||||
|
||||
|
Reference in New Issue
Block a user