This commit is contained in:
Trenton H 2024-05-31 09:49:08 -07:00
parent d04b0f996d
commit 083870ff39
3 changed files with 7 additions and 14 deletions

View File

@ -336,7 +336,7 @@ in the target directory, named according to the current local date or the
value set in `-zn` or `--zip-name`.
If `--data-only` is provided, only the database will be exported. This option is intended
to facilitate database upgrades with needing to clean documents and thumbnails.
to facilitate database upgrades without needing to clean documents and thumbnails from the media directory.
!!! warning
@ -352,7 +352,7 @@ exporter](#exporter) and imports it into paperless.
The importer works just like the exporter. You point it at a directory,
and the script does the rest of the work:
```
```shell
document_importer source
```

View File

@ -56,13 +56,6 @@ from paperless_mail.models import MailAccount
from paperless_mail.models import MailRule
class Manifest:
primary: list
documents: dict
split: list
version: dict
class Command(BaseCommand):
help = (
"Decrypt and rename all files in our collection into a given target "

View File

@ -85,7 +85,7 @@ class Command(BaseCommand):
raise CommandError("That path doesn't appear to be readable")
# Skip this check if operating only on the database
# We can data to exist
# We can expect data to exist in that case
if not self.data_only:
for document_dir in [settings.ORIGINALS_DIR, settings.ARCHIVE_DIR]:
if document_dir.exists() and document_dir.is_dir():
@ -157,7 +157,7 @@ class Command(BaseCommand):
self.stdout.write(self.style.NOTICE("No version.json file located"))
if not self.data_only:
self._check_manifest_valid()
self._check_manifest_files_valid()
with (
disable_signal(
@ -227,7 +227,7 @@ class Command(BaseCommand):
"That directory doesn't appear to contain a manifest.json file.",
)
def _check_manifest_valid(self):
def _check_manifest_files_valid(self):
"""
Attempts to verify the manifest is valid. Namely checking the files
referred to exist and the files can be read from
@ -244,7 +244,7 @@ class Command(BaseCommand):
)
doc_file = record[EXPORTER_FILE_NAME]
doc_path = self.source / doc_file
doc_path: Path = self.source / doc_file
if not doc_path.exists():
raise CommandError(
f'The manifest file refers to "{doc_file}" which does not '
@ -260,7 +260,7 @@ class Command(BaseCommand):
if EXPORTER_ARCHIVE_NAME in record:
archive_file = record[EXPORTER_ARCHIVE_NAME]
doc_archive_path = self.source / archive_file
doc_archive_path: Path = self.source / archive_file
if not doc_archive_path.exists():
raise CommandError(
f"The manifest file refers to {archive_file} which "