Merge models

This commit is contained in:
shamoon 2025-04-08 16:18:32 -07:00
parent 8ad794e189
commit 232f3d6ce4
No known key found for this signature in database
75 changed files with 1805 additions and 1779 deletions

View File

@ -2,18 +2,18 @@ from django.conf import settings
from django.contrib import admin
from guardian.admin import GuardedModelAdmin
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import Note
from documents.models import PaperlessTask
from documents.models import SavedView
from documents.models import SavedViewFilterRule
from documents.models import ShareLink
from documents.models import StoragePath
from documents.models import Tag
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import Note
from paperless.models import PaperlessTask
from paperless.models import SavedView
from paperless.models import SavedViewFilterRule
from paperless.models import ShareLink
from paperless.models import StoragePath
from paperless.models import Tag
if settings.AUDIT_LOG_ENABLED:
from auditlog.admin import LogEntryAdmin

View File

@ -15,13 +15,13 @@ from pikepdf import Pdf
from documents.converters import convert_from_tiff_to_pdf
from documents.data_models import ConsumableDocument
from documents.models import Tag
from documents.plugins.base import ConsumeTaskPlugin
from documents.plugins.base import StopConsumeTaskError
from documents.plugins.helpers import ProgressStatusOptions
from documents.utils import copy_basic_file_stats
from documents.utils import copy_file_with_basic_stats
from documents.utils import maybe_override_pixel_limit
from paperless.models import Tag
if TYPE_CHECKING:
from collections.abc import Callable

View File

@ -8,7 +8,7 @@ if TYPE_CHECKING:
from collections.abc import Callable
from zipfile import ZipFile
from documents.models import Document
from paperless.models import Document
class BulkArchiveStrategy:

View File

@ -19,17 +19,17 @@ from django.utils import timezone
from documents.data_models import ConsumableDocument
from documents.data_models import DocumentMetadataOverrides
from documents.data_models import DocumentSource
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import StoragePath
from documents.permissions import set_permissions_for_object
from documents.plugins.helpers import DocumentsStatusManager
from documents.tasks import bulk_update_documents
from documents.tasks import consume_file
from documents.tasks import update_document_content_maybe_archive_file
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import StoragePath
if TYPE_CHECKING:
from django.contrib.auth.models import User

View File

@ -8,7 +8,7 @@ from typing import Final
from django.core.cache import cache
from documents.models import Document
from paperless.models import Document
if TYPE_CHECKING:
from documents.classifier import DocumentClassifier

View File

@ -14,8 +14,8 @@ from documents.templating.utils import convert_format_str_to_template_format
@register()
def changed_password_check(app_configs, **kwargs):
from documents.models import Document
from paperless.db import GnuPG
from paperless.models import Document
try:
encrypted_doc = (

View File

@ -21,8 +21,8 @@ from documents.caching import CACHE_50_MINUTES
from documents.caching import CLASSIFIER_HASH_KEY
from documents.caching import CLASSIFIER_MODIFIED_KEY
from documents.caching import CLASSIFIER_VERSION_KEY
from documents.models import Document
from documents.models import MatchingModel
from paperless.models import Document
from paperless.models import MatchingModel
logger = logging.getLogger("paperless.classifier")

View File

@ -11,7 +11,7 @@ from documents.caching import CLASSIFIER_MODIFIED_KEY
from documents.caching import CLASSIFIER_VERSION_KEY
from documents.caching import get_thumbnail_modified_key
from documents.classifier import DocumentClassifier
from documents.models import Document
from paperless.models import Document
def suggestions_etag(request, pk: int) -> str | None:

View File

@ -21,14 +21,6 @@ from documents.data_models import DocumentMetadataOverrides
from documents.file_handling import create_source_path_directory
from documents.file_handling import generate_unique_filename
from documents.loggers import LoggingMixin
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import StoragePath
from documents.models import Tag
from documents.models import WorkflowTrigger
from documents.parsers import DocumentParser
from documents.parsers import ParseError
from documents.parsers import get_parser_class_for_mime_type
@ -47,6 +39,14 @@ from documents.templating.workflows import parse_w_workflow_placeholders
from documents.utils import copy_basic_file_stats
from documents.utils import copy_file_with_basic_stats
from documents.utils import run_subprocess
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import StoragePath
from paperless.models import Tag
from paperless.models import WorkflowTrigger
from paperless_mail.parsers import MailDocumentParser

View File

@ -1,8 +1,8 @@
from django.conf import settings as django_settings
from django.contrib.auth.models import User
from documents.models import Document
from paperless.config import GeneralConfig
from paperless.models import Document
def settings(request):

View File

@ -2,9 +2,9 @@ import os
from django.conf import settings
from documents.models import Document
from documents.templating.filepath import validate_filepath_template_and_render
from documents.templating.utils import convert_format_str_to_template_format
from paperless.models import Document
def create_source_path_directory(source_path):

View File

@ -31,15 +31,15 @@ from rest_framework import serializers
from rest_framework.filters import OrderingFilter
from rest_framework_guardian.filters import ObjectPermissionsFilter
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import PaperlessTask
from documents.models import ShareLink
from documents.models import StoragePath
from documents.models import Tag
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import PaperlessTask
from paperless.models import ShareLink
from paperless.models import StoragePath
from paperless.models import Tag
if TYPE_CHECKING:
from collections.abc import Callable

View File

@ -38,10 +38,10 @@ from whoosh.scoring import TF_IDF
from whoosh.util.times import timespan
from whoosh.writing import AsyncWriter
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import Note
from documents.models import User
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import Note
from paperless.models import User
if TYPE_CHECKING:
from django.db.models import QuerySet

View File

@ -2,7 +2,7 @@ from django.core.management.base import BaseCommand
from django.db import connection
from django.db import models
from documents.models import Document
from paperless.models import Document
class Command(BaseCommand):

View File

@ -4,8 +4,8 @@ from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from documents.models import Document
from paperless.db import GnuPG
from paperless.models import Document
class Command(BaseCommand):

View File

@ -8,8 +8,8 @@ from django.core.management.base import BaseCommand
from documents.management.commands.mixins import MultiProcessMixin
from documents.management.commands.mixins import ProgressBarMixin
from documents.models import Document
from documents.tasks import update_document_content_maybe_archive_file
from paperless.models import Document
logger = logging.getLogger("paperless.management.archiver")

View File

@ -19,9 +19,9 @@ from watchdog.observers.polling import PollingObserver
from documents.data_models import ConsumableDocument
from documents.data_models import DocumentMetadataOverrides
from documents.data_models import DocumentSource
from documents.models import Tag
from documents.parsers import is_file_ext_supported
from documents.tasks import consume_file
from paperless.models import Tag
try:
from inotifyrecursive import INotify

View File

@ -35,22 +35,6 @@ if settings.AUDIT_LOG_ENABLED:
from documents.file_handling import delete_empty_directories
from documents.file_handling import generate_filename
from documents.management.commands.mixins import CryptMixin
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import Note
from documents.models import SavedView
from documents.models import SavedViewFilterRule
from documents.models import StoragePath
from documents.models import Tag
from documents.models import UiSettings
from documents.models import Workflow
from documents.models import WorkflowAction
from documents.models import WorkflowActionEmail
from documents.models import WorkflowActionWebhook
from documents.models import WorkflowTrigger
from documents.settings import EXPORTER_ARCHIVE_NAME
from documents.settings import EXPORTER_FILE_NAME
from documents.settings import EXPORTER_THUMBNAIL_NAME
@ -58,6 +42,22 @@ from documents.utils import copy_file_with_basic_stats
from paperless import version
from paperless.db import GnuPG
from paperless.models import ApplicationConfiguration
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import Note
from paperless.models import SavedView
from paperless.models import SavedViewFilterRule
from paperless.models import StoragePath
from paperless.models import Tag
from paperless.models import UiSettings
from paperless.models import Workflow
from paperless.models import WorkflowAction
from paperless.models import WorkflowActionEmail
from paperless.models import WorkflowActionWebhook
from paperless.models import WorkflowTrigger
from paperless_mail.models import MailAccount
from paperless_mail.models import MailRule

View File

@ -9,7 +9,7 @@ from django.core.management import CommandError
from documents.management.commands.mixins import MultiProcessMixin
from documents.management.commands.mixins import ProgressBarMixin
from documents.models import Document
from paperless.models import Document
@dataclasses.dataclass(frozen=True)

View File

@ -23,13 +23,6 @@ from filelock import FileLock
from documents.file_handling import create_source_path_directory
from documents.management.commands.mixins import CryptMixin
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import Note
from documents.models import Tag
from documents.parsers import run_convert
from documents.settings import EXPORTER_ARCHIVE_NAME
from documents.settings import EXPORTER_CRYPTO_SETTINGS_NAME
@ -39,6 +32,13 @@ from documents.signals.handlers import check_paths_and_prune_custom_fields
from documents.signals.handlers import update_filename_and_move_files
from documents.utils import copy_file_with_basic_stats
from paperless import version
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import Note
from paperless.models import Tag
if settings.AUDIT_LOG_ENABLED:
from auditlog.registry import auditlog

View File

@ -5,7 +5,7 @@ from django.core.management.base import BaseCommand
from django.db.models.signals import post_save
from documents.management.commands.mixins import ProgressBarMixin
from documents.models import Document
from paperless.models import Document
class Command(ProgressBarMixin, BaseCommand):

View File

@ -5,11 +5,11 @@ from django.core.management.base import BaseCommand
from documents.classifier import load_classifier
from documents.management.commands.mixins import ProgressBarMixin
from documents.models import Document
from documents.signals.handlers import set_correspondent
from documents.signals.handlers import set_document_type
from documents.signals.handlers import set_storage_path
from documents.signals.handlers import set_tags
from paperless.models import Document
logger = logging.getLogger("paperless.management.retagger")

View File

@ -8,8 +8,8 @@ from django.core.management.base import BaseCommand
from documents.management.commands.mixins import MultiProcessMixin
from documents.management.commands.mixins import ProgressBarMixin
from documents.models import Document
from documents.parsers import get_parser_class_for_mime_type
from paperless.models import Document
def _process_document(doc_id):

View File

@ -7,15 +7,15 @@ from typing import TYPE_CHECKING
from documents.data_models import ConsumableDocument
from documents.data_models import DocumentSource
from documents.models import Correspondent
from documents.models import Document
from documents.models import DocumentType
from documents.models import MatchingModel
from documents.models import StoragePath
from documents.models import Tag
from documents.models import Workflow
from documents.models import WorkflowTrigger
from documents.permissions import get_objects_for_user_owner_aware
from paperless.models import Correspondent
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import MatchingModel
from paperless.models import StoragePath
from paperless.models import Tag
from paperless.models import Workflow
from paperless.models import WorkflowTrigger
if TYPE_CHECKING:
from documents.classifier import DocumentClassifier

File diff suppressed because it is too large Load Diff

View File

@ -10,8 +10,8 @@ from django.conf import settings
from django.utils import timezone
from tqdm import tqdm
from documents.models import Document
from documents.models import PaperlessTask
from paperless.models import Document
from paperless.models import PaperlessTask
class SanityCheckMessages:

View File

@ -37,25 +37,6 @@ if settings.AUDIT_LOG_ENABLED:
from documents import bulk_edit
from documents.data_models import DocumentSource
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import MatchingModel
from documents.models import Note
from documents.models import PaperlessTask
from documents.models import SavedView
from documents.models import SavedViewFilterRule
from documents.models import ShareLink
from documents.models import StoragePath
from documents.models import Tag
from documents.models import UiSettings
from documents.models import Workflow
from documents.models import WorkflowAction
from documents.models import WorkflowActionEmail
from documents.models import WorkflowActionWebhook
from documents.models import WorkflowTrigger
from documents.parsers import is_mime_type_supported
from documents.permissions import get_groups_with_only_permission
from documents.permissions import set_permissions_for_object
@ -63,6 +44,25 @@ from documents.templating.filepath import validate_filepath_template_and_render
from documents.templating.utils import convert_format_str_to_template_format
from documents.validators import uri_validator
from documents.validators import url_validator
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import MatchingModel
from paperless.models import Note
from paperless.models import PaperlessTask
from paperless.models import SavedView
from paperless.models import SavedViewFilterRule
from paperless.models import ShareLink
from paperless.models import StoragePath
from paperless.models import Tag
from paperless.models import UiSettings
from paperless.models import Workflow
from paperless.models import WorkflowAction
from paperless.models import WorkflowActionEmail
from paperless.models import WorkflowActionWebhook
from paperless.models import WorkflowTrigger
if TYPE_CHECKING:
from collections.abc import Iterable

View File

@ -29,22 +29,22 @@ from documents.file_handling import create_source_path_directory
from documents.file_handling import delete_empty_directories
from documents.file_handling import generate_unique_filename
from documents.mail import send_email
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import MatchingModel
from documents.models import PaperlessTask
from documents.models import SavedView
from documents.models import Tag
from documents.models import Workflow
from documents.models import WorkflowAction
from documents.models import WorkflowRun
from documents.models import WorkflowTrigger
from documents.permissions import get_objects_for_user_owner_aware
from documents.permissions import set_permissions_for_object
from documents.templating.workflows import parse_w_workflow_placeholders
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import MatchingModel
from paperless.models import PaperlessTask
from paperless.models import SavedView
from paperless.models import Tag
from paperless.models import Workflow
from paperless.models import WorkflowAction
from paperless.models import WorkflowRun
from paperless.models import WorkflowTrigger
if TYPE_CHECKING:
from pathlib import Path

View File

@ -32,16 +32,6 @@ from documents.data_models import DocumentMetadataOverrides
from documents.double_sided import CollatePlugin
from documents.file_handling import create_source_path_directory
from documents.file_handling import generate_unique_filename
from documents.models import Correspondent
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import PaperlessTask
from documents.models import StoragePath
from documents.models import Tag
from documents.models import Workflow
from documents.models import WorkflowRun
from documents.models import WorkflowTrigger
from documents.parsers import DocumentParser
from documents.parsers import get_parser_class_for_mime_type
from documents.plugins.base import ConsumeTaskPlugin
@ -52,6 +42,16 @@ from documents.sanity_checker import SanityCheckFailedException
from documents.signals import document_updated
from documents.signals.handlers import cleanup_document_deletion
from documents.signals.handlers import run_workflows
from paperless.models import Correspondent
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import PaperlessTask
from paperless.models import StoragePath
from paperless.models import Tag
from paperless.models import Workflow
from paperless.models import WorkflowRun
from paperless.models import WorkflowTrigger
if settings.AUDIT_LOG_ENABLED:
from auditlog.models import LogEntry

View File

@ -17,13 +17,13 @@ from jinja2 import make_logging_undefined
from jinja2.sandbox import SandboxedEnvironment
from jinja2.sandbox import SecurityError
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import StoragePath
from documents.models import Tag
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import StoragePath
from paperless.models import Tag
logger = logging.getLogger("paperless.templating")

View File

@ -1,8 +1,8 @@
from factory import Faker
from factory.django import DjangoModelFactory
from documents.models import Correspondent
from documents.models import Document
from paperless.models import Correspondent
from paperless.models import Document
class CorrespondentFactory(DjangoModelFactory):

View File

@ -7,9 +7,9 @@ from django.utils import timezone
from documents import index
from documents.admin import DocumentAdmin
from documents.models import Document
from documents.tests.utils import DirectoriesMixin
from paperless.admin import PaperlessUserAdmin
from paperless.models import Document
class TestDocumentAdmin(DirectoriesMixin, TestCase):

View File

@ -10,11 +10,11 @@ from django.utils import timezone
from rest_framework import status
from rest_framework.test import APITestCase
from documents.models import Correspondent
from documents.models import Document
from documents.models import DocumentType
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import SampleDirMixin
from paperless.models import Correspondent
from paperless.models import Document
from paperless.models import DocumentType
class TestBulkDownload(DirectoriesMixin, SampleDirMixin, APITestCase):

View File

@ -9,13 +9,13 @@ from guardian.shortcuts import assign_perm
from rest_framework import status
from rest_framework.test import APITestCase
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import Document
from documents.models import DocumentType
from documents.models import StoragePath
from documents.models import Tag
from documents.tests.utils import DirectoriesMixin
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import StoragePath
from paperless.models import Tag
class TestBulkEditAPI(DirectoriesMixin, APITestCase):

View File

@ -7,10 +7,10 @@ from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APITestCase
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.tests.utils import DirectoriesMixin
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
class TestCustomFieldsAPI(DirectoriesMixin, APITestCase):

View File

@ -29,23 +29,23 @@ from documents.caching import CLASSIFIER_HASH_KEY
from documents.caching import CLASSIFIER_MODIFIED_KEY
from documents.caching import CLASSIFIER_VERSION_KEY
from documents.data_models import DocumentSource
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import MatchingModel
from documents.models import Note
from documents.models import SavedView
from documents.models import ShareLink
from documents.models import StoragePath
from documents.models import Tag
from documents.models import Workflow
from documents.models import WorkflowAction
from documents.models import WorkflowTrigger
from documents.signals.handlers import run_workflows
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import DocumentConsumeDelayMixin
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import MatchingModel
from paperless.models import Note
from paperless.models import SavedView
from paperless.models import ShareLink
from paperless.models import StoragePath
from paperless.models import Tag
from paperless.models import Workflow
from paperless.models import WorkflowAction
from paperless.models import WorkflowTrigger
class TestDocumentApi(DirectoriesMixin, DocumentConsumeDelayMixin, APITestCase):

View File

@ -7,10 +7,10 @@ from urllib.parse import quote
from django.contrib.auth.models import User
from rest_framework.test import APITestCase
from documents.models import CustomField
from documents.models import Document
from documents.serialisers import DocumentSerializer
from documents.tests.utils import DirectoriesMixin
from paperless.models import CustomField
from paperless.models import Document
class DocumentWrapper:

View File

@ -8,12 +8,12 @@ from django.utils import timezone
from rest_framework import status
from rest_framework.test import APITestCase
from documents.models import Correspondent
from documents.models import Document
from documents.models import DocumentType
from documents.models import StoragePath
from documents.models import Tag
from documents.tests.utils import DirectoriesMixin
from paperless.models import Correspondent
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import StoragePath
from paperless.models import Tag
class TestApiObjects(DirectoriesMixin, APITestCase):

View File

@ -13,13 +13,13 @@ from guardian.shortcuts import get_users_with_perms
from rest_framework import status
from rest_framework.test import APITestCase
from documents.models import Correspondent
from documents.models import Document
from documents.models import DocumentType
from documents.models import MatchingModel
from documents.models import StoragePath
from documents.models import Tag
from documents.tests.utils import DirectoriesMixin
from paperless.models import Correspondent
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import MatchingModel
from paperless.models import StoragePath
from paperless.models import Tag
class TestApiAuth(DirectoriesMixin, APITestCase):

View File

@ -16,17 +16,17 @@ from whoosh.writing import AsyncWriter
from documents import index
from documents.bulk_edit import set_permissions
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import Note
from documents.models import SavedView
from documents.models import StoragePath
from documents.models import Tag
from documents.models import Workflow
from documents.tests.utils import DirectoriesMixin
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import Note
from paperless.models import SavedView
from paperless.models import StoragePath
from paperless.models import Tag
from paperless.models import Workflow
from paperless_mail.models import MailAccount
from paperless_mail.models import MailRule

View File

@ -8,8 +8,8 @@ from django.test import override_settings
from rest_framework import status
from rest_framework.test import APITestCase
from documents.models import PaperlessTask
from paperless import version
from paperless.models import PaperlessTask
class TestSystemStatus(APITestCase):

View File

@ -7,9 +7,9 @@ from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APITestCase
from documents.models import PaperlessTask
from documents.tests.utils import DirectoriesMixin
from documents.views import TasksViewSet
from paperless.models import PaperlessTask
class TestTasks(DirectoriesMixin, APITestCase):

View File

@ -4,7 +4,7 @@ from django.core.cache import cache
from rest_framework import status
from rest_framework.test import APITestCase
from documents.models import Document
from paperless.models import Document
class TestTrashAPI(APITestCase):

View File

@ -6,15 +6,15 @@ from rest_framework import status
from rest_framework.test import APITestCase
from documents.data_models import DocumentSource
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import DocumentType
from documents.models import StoragePath
from documents.models import Tag
from documents.models import Workflow
from documents.models import WorkflowAction
from documents.models import WorkflowTrigger
from documents.tests.utils import DirectoriesMixin
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import DocumentType
from paperless.models import StoragePath
from paperless.models import Tag
from paperless.models import Workflow
from paperless.models import WorkflowAction
from paperless.models import WorkflowTrigger
class TestApiWorkflows(DirectoriesMixin, APITestCase):

View File

@ -14,14 +14,14 @@ from documents.barcodes import BarcodePlugin
from documents.data_models import ConsumableDocument
from documents.data_models import DocumentMetadataOverrides
from documents.data_models import DocumentSource
from documents.models import Document
from documents.models import Tag
from documents.plugins.base import StopConsumeTaskError
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import DocumentConsumeDelayMixin
from documents.tests.utils import DummyProgressManager
from documents.tests.utils import FileSystemAssertsMixin
from documents.tests.utils import SampleDirMixin
from paperless.models import Document
from paperless.models import Tag
try:
import zxingcpp # noqa: F401

View File

@ -10,14 +10,14 @@ from guardian.shortcuts import get_groups_with_perms
from guardian.shortcuts import get_users_with_perms
from documents import bulk_edit
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import StoragePath
from documents.models import Tag
from documents.tests.utils import DirectoriesMixin
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import StoragePath
from paperless.models import Tag
class TestBulkEdit(DirectoriesMixin, TestCase):

View File

@ -9,8 +9,8 @@ from django.test import override_settings
from documents.checks import changed_password_check
from documents.checks import filename_format_check
from documents.checks import parser_check
from documents.models import Document
from documents.tests.factories import DocumentFactory
from paperless.models import Document
class TestDocumentChecks(TestCase):

View File

@ -12,13 +12,13 @@ from documents.classifier import ClassifierModelCorruptError
from documents.classifier import DocumentClassifier
from documents.classifier import IncompatibleClassifierVersionError
from documents.classifier import load_classifier
from documents.models import Correspondent
from documents.models import Document
from documents.models import DocumentType
from documents.models import MatchingModel
from documents.models import StoragePath
from documents.models import Tag
from documents.tests.utils import DirectoriesMixin
from paperless.models import Correspondent
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import MatchingModel
from paperless.models import StoragePath
from paperless.models import Tag
def dummy_preprocess(content: str):

View File

@ -20,12 +20,6 @@ from guardian.core import ObjectPermissionChecker
from documents.consumer import ConsumerError
from documents.data_models import DocumentMetadataOverrides
from documents.data_models import DocumentSource
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import Document
from documents.models import DocumentType
from documents.models import StoragePath
from documents.models import Tag
from documents.parsers import DocumentParser
from documents.parsers import ParseError
from documents.plugins.helpers import ProgressStatusOptions
@ -33,6 +27,12 @@ from documents.tasks import sanity_check
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import FileSystemAssertsMixin
from documents.tests.utils import GetConsumerMixin
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import StoragePath
from paperless.models import Tag
from paperless_mail.models import MailRule
from paperless_mail.parsers import MailDocumentParser

View File

@ -2,7 +2,7 @@ from django.test import TestCase
from whoosh import query
from documents.index import get_permissions_criterias
from documents.models import User
from paperless.models import User
class TestDelayedQuery(TestCase):

View File

@ -8,9 +8,9 @@ from django.test import TestCase
from django.test import override_settings
from django.utils import timezone
from documents.models import Correspondent
from documents.models import Document
from documents.tasks import empty_trash
from paperless.models import Correspondent
from paperless.models import Document
class TestDocument(TestCase):

View File

@ -16,15 +16,15 @@ from django.utils import timezone
from documents.file_handling import create_source_path_directory
from documents.file_handling import delete_empty_directories
from documents.file_handling import generate_filename
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import StoragePath
from documents.tasks import empty_trash
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import FileSystemAssertsMixin
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import StoragePath
class TestFileHandling(DirectoriesMixin, FileSystemAssertsMixin, TestCase):

View File

@ -3,8 +3,8 @@ from unittest import mock
from django.test import TestCase
from documents import index
from documents.models import Document
from documents.tests.utils import DirectoriesMixin
from paperless.models import Document
class TestAutoComplete(DirectoriesMixin, TestCase):

View File

@ -14,10 +14,10 @@ from django.test import TestCase
from django.test import override_settings
from documents.file_handling import generate_filename
from documents.models import Document
from documents.tasks import update_document_content_maybe_archive_file
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import FileSystemAssertsMixin
from paperless.models import Document
sample_file = os.path.join(os.path.dirname(__file__), "samples", "simple.pdf")

View File

@ -15,9 +15,9 @@ from django.test import override_settings
from documents.consumer import ConsumerError
from documents.data_models import ConsumableDocument
from documents.management.commands import document_consumer
from documents.models import Tag
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import DocumentConsumeDelayMixin
from paperless.models import Tag
class ConsumerThread(Thread):

View File

@ -25,24 +25,24 @@ from guardian.models import UserObjectPermission
from guardian.shortcuts import assign_perm
from documents.management.commands import document_exporter
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import Note
from documents.models import StoragePath
from documents.models import Tag
from documents.models import User
from documents.models import Workflow
from documents.models import WorkflowAction
from documents.models import WorkflowTrigger
from documents.sanity_checker import check_sanity
from documents.settings import EXPORTER_FILE_NAME
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import FileSystemAssertsMixin
from documents.tests.utils import SampleDirMixin
from documents.tests.utils import paperless_environment
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import Note
from paperless.models import StoragePath
from paperless.models import Tag
from paperless.models import User
from paperless.models import Workflow
from paperless.models import WorkflowAction
from paperless.models import WorkflowTrigger
from paperless_mail.models import MailAccount

View File

@ -4,7 +4,7 @@ from django.core.management import CommandError
from django.core.management import call_command
from django.test import TestCase
from documents.models import Document
from paperless.models import Document
class TestFuzzyMatchCommand(TestCase):

View File

@ -9,12 +9,12 @@ from django.core.management.base import CommandError
from django.test import TestCase
from documents.management.commands.document_importer import Command
from documents.models import Document
from documents.settings import EXPORTER_ARCHIVE_NAME
from documents.settings import EXPORTER_FILE_NAME
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import FileSystemAssertsMixin
from documents.tests.utils import SampleDirMixin
from paperless.models import Document
class TestCommandImport(

View File

@ -2,12 +2,12 @@ from django.core.management import call_command
from django.core.management.base import CommandError
from django.test import TestCase
from documents.models import Correspondent
from documents.models import Document
from documents.models import DocumentType
from documents.models import StoragePath
from documents.models import Tag
from documents.tests.utils import DirectoriesMixin
from paperless.models import Correspondent
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import StoragePath
from paperless.models import Tag
class TestRetagger(DirectoriesMixin, TestCase):

View File

@ -6,10 +6,10 @@ from django.core.management import call_command
from django.test import TestCase
from documents.management.commands.document_thumbnails import _process_document
from documents.models import Document
from documents.parsers import get_default_thumbnail
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import FileSystemAssertsMixin
from paperless.models import Document
class TestMakeThumbnails(DirectoriesMixin, FileSystemAssertsMixin, TestCase):

View File

@ -9,11 +9,11 @@ from django.test import TestCase
from django.test import override_settings
from documents import matching
from documents.models import Correspondent
from documents.models import Document
from documents.models import DocumentType
from documents.models import Tag
from documents.signals import document_consumption_finished
from paperless.models import Correspondent
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import Tag
class _TestMatchingBase(TestCase):

View File

@ -1,5 +1,5 @@
from documents.models import StoragePath
from documents.tests.utils import TestMigrations
from paperless.models import StoragePath
class TestMigrateStoragePathToTemplate(TestMigrations):

View File

@ -1,9 +1,9 @@
from django.test import TestCase
from documents.models import Correspondent
from documents.models import Document
from documents.tests.factories import CorrespondentFactory
from documents.tests.factories import DocumentFactory
from paperless.models import Correspondent
from paperless.models import Document
class CorrespondentTestCase(TestCase):

View File

@ -7,9 +7,9 @@ import filelock
from django.conf import settings
from django.test import TestCase
from documents.models import Document
from documents.sanity_checker import check_sanity
from documents.tests.utils import DirectoriesMixin
from paperless.models import Document
class TestSanityCheck(DirectoriesMixin, TestCase):

View File

@ -7,13 +7,13 @@ from django.test import TestCase
from documents.data_models import ConsumableDocument
from documents.data_models import DocumentMetadataOverrides
from documents.data_models import DocumentSource
from documents.models import PaperlessTask
from documents.signals.handlers import before_task_publish_handler
from documents.signals.handlers import task_failure_handler
from documents.signals.handlers import task_postrun_handler
from documents.signals.handlers import task_prerun_handler
from documents.tests.test_consumer import fake_magic_from_file
from documents.tests.utils import DirectoriesMixin
from paperless.models import PaperlessTask
@mock.patch("documents.consumer.magic.from_file", fake_magic_from_file)

View File

@ -8,15 +8,15 @@ from django.test import TestCase
from django.utils import timezone
from documents import tasks
from documents.models import Correspondent
from documents.models import Document
from documents.models import DocumentType
from documents.models import Tag
from documents.sanity_checker import SanityCheckFailedException
from documents.sanity_checker import SanityCheckMessages
from documents.tests.test_classifier import dummy_preprocess
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import FileSystemAssertsMixin
from paperless.models import Correspondent
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import Tag
class TestIndexReindex(DirectoriesMixin, TestCase):

View File

@ -10,10 +10,10 @@ from django.test import override_settings
from django.utils import timezone
from rest_framework import status
from documents.models import Document
from documents.models import ShareLink
from documents.tests.utils import DirectoriesMixin
from paperless.models import ApplicationConfiguration
from paperless.models import Document
from paperless.models import ShareLink
class TestViews(DirectoriesMixin, TestCase):

View File

@ -25,25 +25,25 @@ from documents import tasks
from documents.data_models import ConsumableDocument
from documents.data_models import DocumentSource
from documents.matching import document_matches_workflow
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import CustomFieldInstance
from documents.models import Document
from documents.models import DocumentType
from documents.models import MatchingModel
from documents.models import StoragePath
from documents.models import Tag
from documents.models import Workflow
from documents.models import WorkflowAction
from documents.models import WorkflowActionEmail
from documents.models import WorkflowActionWebhook
from documents.models import WorkflowRun
from documents.models import WorkflowTrigger
from documents.signals import document_consumption_finished
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import DummyProgressManager
from documents.tests.utils import FileSystemAssertsMixin
from documents.tests.utils import SampleDirMixin
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import CustomFieldInstance
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import MatchingModel
from paperless.models import StoragePath
from paperless.models import Tag
from paperless.models import Workflow
from paperless.models import WorkflowAction
from paperless.models import WorkflowActionEmail
from paperless.models import WorkflowActionWebhook
from paperless.models import WorkflowRun
from paperless.models import WorkflowTrigger
from paperless_mail.models import MailAccount
from paperless_mail.models import MailRule

View File

@ -113,20 +113,6 @@ from documents.matching import match_correspondents
from documents.matching import match_document_types
from documents.matching import match_storage_paths
from documents.matching import match_tags
from documents.models import Correspondent
from documents.models import CustomField
from documents.models import Document
from documents.models import DocumentType
from documents.models import Note
from documents.models import PaperlessTask
from documents.models import SavedView
from documents.models import ShareLink
from documents.models import StoragePath
from documents.models import Tag
from documents.models import UiSettings
from documents.models import Workflow
from documents.models import WorkflowAction
from documents.models import WorkflowTrigger
from documents.parsers import get_parser_class_for_mime_type
from documents.parsers import parse_date_generator
from documents.permissions import PaperlessAdminPermissions
@ -171,6 +157,20 @@ from paperless import version
from paperless.celery import app as celery_app
from paperless.config import GeneralConfig
from paperless.db import GnuPG
from paperless.models import Correspondent
from paperless.models import CustomField
from paperless.models import Document
from paperless.models import DocumentType
from paperless.models import Note
from paperless.models import PaperlessTask
from paperless.models import SavedView
from paperless.models import ShareLink
from paperless.models import StoragePath
from paperless.models import Tag
from paperless.models import UiSettings
from paperless.models import Workflow
from paperless.models import WorkflowAction
from paperless.models import WorkflowTrigger
from paperless.serialisers import GroupSerializer
from paperless.serialisers import UserSerializer
from paperless.views import StandardPagination

View File

@ -10,7 +10,7 @@ from django.contrib.auth.models import User
from django.forms import ValidationError
from django.urls import reverse
from documents.models import Document
from paperless.models import Document
from paperless.signals import handle_social_account_updated
logger = logging.getLogger("paperless.auth")

File diff suppressed because it is too large Load Diff

View File

@ -37,9 +37,9 @@ from documents.data_models import ConsumableDocument
from documents.data_models import DocumentMetadataOverrides
from documents.data_models import DocumentSource
from documents.loggers import LoggingMixin
from documents.models import Correspondent
from documents.parsers import is_mime_type_supported
from documents.tasks import consume_file
from paperless.models import Correspondent
from paperless_mail.models import MailAccount
from paperless_mail.models import MailRule
from paperless_mail.models import ProcessedMail

View File

@ -2,7 +2,7 @@ from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
import documents.models as document_models
import paperless.models as document_models
class MailAccount(document_models.ModelWithOwner):

View File

@ -7,10 +7,10 @@ from guardian.shortcuts import assign_perm
from rest_framework import status
from rest_framework.test import APITestCase
from documents.models import Correspondent
from documents.models import DocumentType
from documents.models import Tag
from documents.tests.utils import DirectoriesMixin
from paperless.models import Correspondent
from paperless.models import DocumentType
from paperless.models import Tag
from paperless_mail.models import MailAccount
from paperless_mail.models import MailRule
from paperless_mail.tests.test_mail import BogusMailBox

View File

@ -24,9 +24,9 @@ from imap_tools import errors
from rest_framework import status
from rest_framework.test import APITestCase
from documents.models import Correspondent
from documents.tests.utils import DirectoriesMixin
from documents.tests.utils import FileSystemAssertsMixin
from paperless.models import Correspondent
from paperless_mail import tasks
from paperless_mail.mail import MailAccountHandler
from paperless_mail.mail import MailError