mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-29 11:09:27 -05:00
Fix decrypt
This commit is contained in:
parent
4c8a7b9fa6
commit
1ce5a78bc6
@ -1,3 +1,5 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from django.core.management.base import CommandError
|
from django.core.management.base import CommandError
|
||||||
@ -67,7 +69,7 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
document.storage_type = Document.STORAGE_TYPE_UNENCRYPTED
|
document.storage_type = Document.STORAGE_TYPE_UNENCRYPTED
|
||||||
|
|
||||||
ext: str = document.filename.suffix
|
ext: str = Path(document.filename).suffix
|
||||||
|
|
||||||
if not ext == ".gpg":
|
if not ext == ".gpg":
|
||||||
raise CommandError(
|
raise CommandError(
|
||||||
@ -75,7 +77,7 @@ class Command(BaseCommand):
|
|||||||
f"end with .gpg",
|
f"end with .gpg",
|
||||||
)
|
)
|
||||||
|
|
||||||
document.filename = document.filename.stem
|
document.filename = Path(document.filename).stem
|
||||||
|
|
||||||
with document.source_path.open("wb") as f:
|
with document.source_path.open("wb") as f:
|
||||||
f.write(raw_document)
|
f.write(raw_document)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user