Refactor: split views.py into documents/views/ module

documents/views.py suffers the same problem as serialisers.py: a
single 5,395-line file covering every REST resource in the app.
Restructures it into a package, one module per domain area, matching
the same layout used for documents/serialisers/.

paperless/urls.py and paperless_mail/views.py are updated to import
from the new submodules. Test files that imported or mock.patch'd
documents.views or documents.serialisers symbols directly are updated
to point at the correct submodule for both splits. The mypy and
pyrefly baselines are updated to reference the new file paths, and a
stale comment in chat_qa.j2 pointing at the old location of
_get_llm_output_language is corrected.
This commit is contained in:
stumpylog
2026-10-03 14:34:19 -07:00
committed by Trenton H
parent 12fa696c73
commit 08ea8b90a4
37 changed files with 6884 additions and 6554 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ from documents.models import WorkflowActionWebhook
from documents.models import WorkflowRun
from documents.models import WorkflowTrigger
from documents.plugins.base import StopConsumeTaskError
from documents.serialisers import WorkflowTriggerSerializer
from documents.serialisers.workflows import WorkflowTriggerSerializer
from documents.signals import document_consumption_finished
from documents.tests.utils import SampleDirMixin
from documents.workflows.actions import execute_password_removal_action