mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-12-03 01:44:49 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55eb243fb7 |
No files matched your search
@@ -1,6 +1,8 @@
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
version: 2
|
||||
# Required for uv support for now
|
||||
enable-beta-ecosystems: true
|
||||
updates:
|
||||
# Enable version updates for pnpm
|
||||
- package-ecosystem: "npm"
|
||||
|
||||
@@ -104,7 +104,7 @@ jobs:
|
||||
with:
|
||||
python-version: "${{ matrix.python-version }}"
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: ${{ env.DEFAULT_UV_VERSION }}
|
||||
enable-cache: true
|
||||
@@ -174,7 +174,7 @@ jobs:
|
||||
with:
|
||||
python-version: "${{ env.DEFAULT_PYTHON }}"
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: ${{ env.DEFAULT_UV_VERSION }}
|
||||
enable-cache: true
|
||||
|
||||
@@ -109,7 +109,7 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
|
||||
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
@@ -185,20 +185,20 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
|
||||
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login to Docker Hub
|
||||
if: needs.build-arch.outputs.push-external == 'true'
|
||||
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
|
||||
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Login to Quay.io
|
||||
if: needs.build-arch.outputs.push-external == 'true'
|
||||
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
|
||||
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
|
||||
with:
|
||||
registry: quay.io
|
||||
username: ${{ secrets.QUAY_USERNAME }}
|
||||
|
||||
@@ -79,7 +79,7 @@ jobs:
|
||||
with:
|
||||
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: ${{ env.DEFAULT_UV_VERSION }}
|
||||
enable-cache: true
|
||||
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
|
||||
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
||||
with:
|
||||
package_json_file: src-ui/package.json
|
||||
- name: Use Node.js 24
|
||||
@@ -115,7 +115,7 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
|
||||
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
||||
with:
|
||||
package_json_file: src-ui/package.json
|
||||
- name: Use Node.js 24
|
||||
@@ -154,7 +154,7 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
|
||||
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
||||
with:
|
||||
package_json_file: src-ui/package.json
|
||||
- name: Use Node.js 24
|
||||
@@ -193,7 +193,7 @@ jobs:
|
||||
runs-on: ubuntu-26.04
|
||||
permissions:
|
||||
contents: read
|
||||
container: mcr.microsoft.com/playwright:v1.65.1-resolute
|
||||
container: mcr.microsoft.com/playwright:v1.64.1-resolute
|
||||
env:
|
||||
PLAYWRIGHT_BROWSERS_PATH: /ms-playwright
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
@@ -203,7 +203,7 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
|
||||
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
||||
with:
|
||||
package_json_file: src-ui/package.json
|
||||
- name: Use Node.js 24
|
||||
@@ -218,7 +218,7 @@ jobs:
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: '0.13.x'
|
||||
enable-cache: false
|
||||
@@ -258,7 +258,7 @@ jobs:
|
||||
fetch-depth: 2
|
||||
persist-credentials: false
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
|
||||
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
||||
with:
|
||||
package_json_file: src-ui/package.json
|
||||
- name: Use Node.js 24
|
||||
|
||||
@@ -26,4 +26,4 @@ jobs:
|
||||
with:
|
||||
python-version: "3.14"
|
||||
- name: Run prek
|
||||
uses: j178/prek-action@7b101f8338a08d2bd6fdb3625e4e7692428763a3 # v3.1.1
|
||||
uses: j178/prek-action@44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d # v3.1.0
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
# ---- Frontend Build ----
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
|
||||
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
||||
with:
|
||||
package_json_file: src-ui/package.json
|
||||
- name: Use Node.js 24
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
with:
|
||||
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: ${{ env.DEFAULT_UV_VERSION }}
|
||||
enable-cache: false
|
||||
@@ -172,7 +172,7 @@ jobs:
|
||||
fi
|
||||
- name: Create release and changelog
|
||||
id: create-release
|
||||
uses: release-drafter/release-drafter@d1a19e60e81a7e650d00a7de9277f87e439117ea # v7.11.0
|
||||
uses: release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0 # v7.10.0
|
||||
with:
|
||||
name: Paperless-ngx ${{ steps.get-version.outputs.version }}
|
||||
tag: ${{ steps.get-version.outputs.version }}
|
||||
@@ -213,7 +213,7 @@ jobs:
|
||||
with:
|
||||
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: ${{ env.DEFAULT_UV_VERSION }}
|
||||
enable-cache: false
|
||||
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Run zizmor
|
||||
uses: zizmorcore/zizmor-action@1b4550e929643b8b26a62303c6bd64814271a4f1 # v0.9.2
|
||||
uses: zizmorcore/zizmor-action@53290badfa369cb0bf7ad16342cb62c2fa47ac7b # v0.8.0
|
||||
semgrep:
|
||||
name: Semgrep CE
|
||||
runs-on: ubuntu-26.04
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
- name: Run Semgrep
|
||||
run: semgrep scan --config auto --sarif-output results.sarif
|
||||
- name: Upload results to GitHub code scanning
|
||||
uses: github/codeql-action/upload-sarif@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea # v4.39.4
|
||||
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
|
||||
if: always()
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea # v4.39.4
|
||||
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
@@ -47,4 +47,4 @@ jobs:
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea # v4.39.4
|
||||
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
token: ${{ secrets.PNGX_BOT_PAT }}
|
||||
persist-credentials: false
|
||||
- name: crowdin action
|
||||
uses: crowdin/github-action@d651c77756acbe11a31d77a6fb79d8a239e1e05a # v3.6.0
|
||||
uses: crowdin/github-action@959dc74ac104447731cba99a016f85d0ae719788 # v3.5.0
|
||||
with:
|
||||
upload_translations: false
|
||||
download_translations: true
|
||||
|
||||
@@ -19,6 +19,6 @@ jobs:
|
||||
if: github.event_name == 'pull_request_target' && (github.event.action == 'opened' || github.event.action == 'reopened') && github.event.pull_request.user.login != 'dependabot'
|
||||
steps:
|
||||
- name: Label PR with release-drafter
|
||||
uses: release-drafter/release-drafter@d1a19e60e81a7e650d00a7de9277f87e439117ea # v7.11.0
|
||||
uses: release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0 # v7.10.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
with:
|
||||
packages: gettext
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
||||
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
||||
with:
|
||||
version: ${{ env.DEFAULT_UV_VERSION }}
|
||||
enable-cache: true
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
PAPERLESS_SECRET_KEY: "ci-translate-not-a-real-secret"
|
||||
run: cd src/ && uv run manage.py makemessages -l en_US -i "samples*"
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
|
||||
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
||||
with:
|
||||
package_json_file: src-ui/package.json
|
||||
- name: Use Node.js 24
|
||||
|
||||
+182
-85
@@ -17,7 +17,6 @@ src/documents/admin.py:0: error: Missing type arguments for generic type "Tabula
|
||||
src/documents/admin.py:0: error: Missing type arguments for generic type "TabularInline" [type-arg]
|
||||
src/documents/admin.py:0: error: Skipping analyzing "auditlog.admin": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/admin.py:0: error: Skipping analyzing "auditlog.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/admin.py:0: error: Skipping analyzing "treenode.admin": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/barcodes.py:0: error: "Image" has no attribute "filename" [attr-defined]
|
||||
src/documents/bulk_download.py:0: error: Return type "None" of "add_document" incompatible with return type "Never" in supertype "BulkArchiveStrategy" [override]
|
||||
src/documents/bulk_download.py:0: error: Return type "None" of "add_document" incompatible with return type "Never" in supertype "BulkArchiveStrategy" [override]
|
||||
@@ -39,10 +38,13 @@ src/documents/bulk_edit.py:0: error: Invalid index type "str" for "dict[FieldDat
|
||||
src/documents/bulk_edit.py:0: error: List comprehension has incompatible type List[tuple[int, Any]]; expected List[int] [misc]
|
||||
src/documents/bulk_edit.py:0: error: List comprehension has incompatible type List[tuple[int, None]]; expected List[int] [misc]
|
||||
src/documents/bulk_edit.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/bulk_edit.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/bulk_edit.py:0: error: Need type annotation for "to_create" (hint: "to_create: list[<type>] = ...") [var-annotated]
|
||||
src/documents/bulk_edit.py:0: error: Skipping analyzing "auditlog.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/bulk_edit.py:0: error: Unexpected keyword argument "transaction_id" for "delete" of "QuerySet" [call-arg]
|
||||
src/documents/bulk_operations.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/bulk_operations.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/bulk_operations.py:0: error: Skipping analyzing "auditlog.context": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/bulk_operations.py:0: error: Skipping analyzing "auditlog.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/caching.py:0: error: Argument 1 to "hexlify" has incompatible type "bytes | None"; expected "Buffer" [arg-type]
|
||||
src/documents/caching.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/caching.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -87,6 +89,7 @@ src/documents/classifier.py:0: error: Incompatible types in assignment (expressi
|
||||
src/documents/classifier.py:0: error: Incompatible types in assignment (expression has type "None", variable has type "DocumentClassifier") [assignment]
|
||||
src/documents/classifier.py:0: error: Incompatible types in assignment (expression has type "None", variable has type "DocumentClassifier") [assignment]
|
||||
src/documents/classifier.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "None") [assignment]
|
||||
src/documents/classifier.py:0: error: Item "None" of "str | None" has no attribute "encode" [union-attr]
|
||||
src/documents/classifier.py:0: error: List comprehension has incompatible type List[int]; expected List[list[int]] [misc]
|
||||
src/documents/classifier.py:0: error: Module "sklearn.exceptions" has no attribute "InconsistentVersionWarning" [attr-defined]
|
||||
src/documents/classifier.py:0: error: Unsupported operand types for >= ("datetime" and "None") [operator]
|
||||
@@ -112,6 +115,7 @@ src/documents/consumer.py:0: error: Argument "logger" to "run_subprocess" has in
|
||||
src/documents/consumer.py:0: error: Argument "text" to "_store" of "ConsumerPlugin" has incompatible type "str | Any | None"; expected "str" [arg-type]
|
||||
src/documents/consumer.py:0: error: Argument 1 to "compute_checksum" has incompatible type "Path | None"; expected "Path" [arg-type]
|
||||
src/documents/consumer.py:0: error: Argument 1 to "create_source_path_directory" has incompatible type "Path | None"; expected "Path" [arg-type]
|
||||
src/documents/consumer.py:0: error: Argument 1 to "get_value_field_name" of "CustomFieldInstance" has incompatible type "str"; expected "FieldDataType" [arg-type]
|
||||
src/documents/consumer.py:0: error: Argument 1 to "validate_path_in_root" has incompatible type "Path | None"; expected "Path" [arg-type]
|
||||
src/documents/consumer.py:0: error: Argument 2 to "parse_w_workflow_placeholders" has incompatible type "str | None"; expected "str" [arg-type]
|
||||
src/documents/consumer.py:0: error: Argument 3 to "parse_w_workflow_placeholders" has incompatible type "str | None"; expected "str" [arg-type]
|
||||
@@ -133,19 +137,12 @@ src/documents/consumer.py:0: error: Item "None" of "Document | None" has no attr
|
||||
src/documents/consumer.py:0: error: List item 2 has incompatible type "Path"; expected "str" [list-item]
|
||||
src/documents/consumer.py:0: error: Return type "ConsumeFileSuccessResult" of "run" incompatible with return type "str | None" in supertype "documents.plugins.base.ConsumeTaskPlugin" [override]
|
||||
src/documents/consumer.py:0: error: Too many arguments for "__init__" of "object" [call-arg]
|
||||
src/documents/consumer.py:0: error: Value of type "dict[Any, Any] | None" is not indexable [index]
|
||||
src/documents/context_processors.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/converters.py:0: error: List item 3 has incompatible type "Path"; expected "str" [list-item]
|
||||
src/documents/converters.py:0: error: List item 4 has incompatible type "Path"; expected "str" [list-item]
|
||||
src/documents/converters.py:0: error: Skipping analyzing "img2pdf": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/data_models.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/data_models.py:0: error: Incompatible types in assignment (expression has type "None", variable has type "str") [assignment]
|
||||
src/documents/data_models.py:0: error: Item "Group" of "Group | dict[Any, Any]" has no attribute "__iter__" (not iterable) [union-attr]
|
||||
src/documents/data_models.py:0: error: Item "Group" of "Group | dict[Any, Any]" has no attribute "__iter__" (not iterable) [union-attr]
|
||||
src/documents/data_models.py:0: error: Item "list[str]" of "Any | list[str]" has no attribute "values_list" [union-attr]
|
||||
src/documents/data_models.py:0: error: Item "list[str]" of "Any | list[str]" has no attribute "values_list" [union-attr]
|
||||
src/documents/data_models.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/data_models.py:0: error: Value of type "Group | dict[Any, Any]" is not indexable [index]
|
||||
src/documents/data_models.py:0: error: Value of type "Group | dict[Any, Any]" is not indexable [index]
|
||||
src/documents/export/sinks.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/export/sinks.py:0: error: Missing type arguments for generic type "AbstractContextManager" [type-arg]
|
||||
src/documents/export/sinks.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
@@ -194,6 +191,8 @@ src/documents/filters.py:0: error: Function is missing a type annotation [no-un
|
||||
src/documents/filters.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/filters.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/filters.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/filters.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/filters.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/filters.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/filters.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/filters.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -203,6 +202,7 @@ src/documents/filters.py:0: error: Function is missing a type annotation for one
|
||||
src/documents/filters.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/filters.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/filters.py:0: error: Incompatible types in assignment (expression has type "CharField", variable has type "BooleanField | None") [assignment]
|
||||
src/documents/filters.py:0: error: Incompatible types in assignment (expression has type "DateQueryField", variable has type "BooleanField | None") [assignment]
|
||||
src/documents/filters.py:0: error: Incompatible types in assignment (expression has type "Field[Any, Any, Any, Any]", variable has type "BooleanField | None") [assignment]
|
||||
src/documents/filters.py:0: error: Incompatible types in assignment (expression has type "IntegerField", variable has type "BooleanField | None") [assignment]
|
||||
src/documents/filters.py:0: error: Incompatible types in assignment (expression has type "ListField", variable has type "BooleanField | None") [assignment]
|
||||
@@ -232,7 +232,6 @@ src/documents/management/commands/document_consumer.py:0: error: Function is mis
|
||||
src/documents/management/commands/document_consumer.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/management/commands/document_consumer.py:0: error: Incompatible types in assignment (expression has type "Path", variable has type "str") [assignment]
|
||||
src/documents/management/commands/document_create_classifier.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/management/commands/document_exporter.py:0: error: Argument 1 to "add" of "set" has incompatible type "Path"; expected "str" [arg-type]
|
||||
src/documents/management/commands/document_exporter.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/management/commands/document_exporter.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/management/commands/document_exporter.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "Path") [assignment]
|
||||
@@ -286,8 +285,6 @@ src/documents/management/commands/prune_audit_logs.py:0: error: Function is miss
|
||||
src/documents/management/commands/prune_audit_logs.py:0: error: Skipping analyzing "auditlog.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/matching.py:0: error: Argument 1 to "existing_document_matches_workflow" has incompatible type "ConsumableDocument | Document"; expected "Document" [arg-type]
|
||||
src/documents/matching.py:0: error: Argument 1 to "issubset" of "set" has incompatible type "set[int] | None"; expected "Iterable[object]" [arg-type]
|
||||
src/documents/matching.py:0: error: Argument 1 to "matches" has incompatible type "WorkflowTrigger"; expected "MatchingModel" [arg-type]
|
||||
src/documents/matching.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/matching.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/matching.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/matching.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -340,21 +337,12 @@ src/documents/models.py:0: error: Function is missing a type annotation [no-unt
|
||||
src/documents/models.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/models.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/models.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/models.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/models.py:0: error: Signature of "delete" incompatible with supertype "django.db.models.base.Model" [override]
|
||||
src/documents/models.py:0: error: Skipping analyzing "auditlog.registry": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/models.py:0: error: Skipping analyzing "django_softdelete.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/models.py:0: error: Skipping analyzing "multiselectfield": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/models.py:0: error: Skipping analyzing "treenode.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/models.py:0: error: Unexpected keyword argument "transaction_id" for "delete" of "Model" [call-arg]
|
||||
src/documents/models.py:0: error: Unexpected keyword argument "transaction_id" for "delete" of "QuerySet" [call-arg]
|
||||
src/documents/parsers.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/parsers.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/parsers.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/parsers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/parsers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/parsers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/parsers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/parsers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/parsers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/parsers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -366,21 +354,14 @@ src/documents/permissions.py:0: error: Function is missing a return type annotat
|
||||
src/documents/permissions.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/permissions.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/permissions.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/permissions.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/permissions.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/permissions.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/permissions.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/permissions.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/permissions.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/permissions.py:0: error: Item "list[str]" of "Any | list[str] | QuerySet[User, User]" has no attribute "exclude" [union-attr]
|
||||
src/documents/permissions.py:0: error: Item "list[str]" of "Any | list[str] | QuerySet[User, User]" has no attribute "exists" [union-attr]
|
||||
src/documents/permissions.py:0: error: Item "list[str]" of "Any | list[str] | QuerySet[User, User]" has no attribute "exists" [union-attr]
|
||||
src/documents/permissions.py:0: error: Incompatible return value type (got "QuerySet[Model, ModelT]", expected "QuerySet[ModelT, ModelT]") [return-value]
|
||||
src/documents/permissions.py:0: error: Missing type arguments for generic type "QuerySet" [type-arg]
|
||||
src/documents/permissions.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/permissions.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/permissions.py:0: error: Missing type arguments for generic type "list" [type-arg]
|
||||
src/documents/permissions.py:0: error: Type argument "int" of "QuerySet" must be a subtype of "Model" [type-var]
|
||||
src/documents/permissions.py:0: error: Type argument "int" of "QuerySet" must be a subtype of "Model" [type-var]
|
||||
src/documents/permissions.py:0: error: TypedDict key must be a string literal; expected one of ("users", "groups") [literal-required]
|
||||
src/documents/plugins/helpers.py:0: error: Skipping analyzing "channels_redis.pubsub": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/regex.py:0: error: "error" has no attribute "msg" [attr-defined]
|
||||
src/documents/regex.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -396,6 +377,7 @@ src/documents/search/_backend.py:0: error: Argument "args" to "apply_async" of "
|
||||
src/documents/search/_backend.py:0: error: Argument "args" to "apply_async" of "Task" has incompatible type "list[int]"; expected "tuple[Any, ...] | None" [arg-type]
|
||||
src/documents/search/_backend.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/search/_backend.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/search/_backend.py:0: error: Incompatible types in assignment (expression has type "Document | None", variable has type "Document") [assignment]
|
||||
src/documents/search/_backend.py:0: error: Incompatible types in assignment (expression has type "SoftFileLock", variable has type "None") [assignment]
|
||||
src/documents/search/_backend.py:0: error: List comprehension has incompatible type List[tuple[DocAddress, Any]]; expected List[tuple[DocAddress]] [misc]
|
||||
src/documents/search/_backend.py:0: error: List comprehension has incompatible type List[tuple[DocAddress, Any]]; expected List[tuple[DocAddress]] [misc]
|
||||
@@ -408,7 +390,6 @@ src/documents/search/_query.py:0: error: Argument 3 to "Term" has incompatible t
|
||||
src/documents/search/_query.py:0: error: Argument 3 to "Term" has incompatible type "**dict[str, int | None]"; expected "bool" [arg-type]
|
||||
src/documents/search/_query.py:0: error: Unexpected keyword argument "children" for "Node" [call-arg]
|
||||
src/documents/search/_schema.py:0: error: Redundant cast to "Path" [redundant-cast]
|
||||
src/documents/search/_schema.py:0: error: Unexpected keyword argument "fast" for "add_json_field" of "SchemaBuilder" [call-arg]
|
||||
src/documents/serialisers.py:0: error: "type[_MT?]" has no attribute "_meta" [attr-defined]
|
||||
src/documents/serialisers.py:0: error: "type[_MT?]" has no attribute "objects" [attr-defined]
|
||||
src/documents/serialisers.py:0: error: "type[_MT?]" has no attribute "objects" [attr-defined]
|
||||
@@ -418,8 +399,12 @@ src/documents/serialisers.py:0: error: Argument "default" to "MultipleChoiceFiel
|
||||
src/documents/serialisers.py:0: error: Argument 1 of "get_value" is incompatible with supertype "rest_framework.fields.Field"; supertype defines the argument type as "Mapping[str, Any]" [override]
|
||||
src/documents/serialisers.py:0: error: Argument 1 of "update" is incompatible with supertype "rest_framework.serializers.BaseSerializer"; supertype defines the argument type as "dict[str, Any]" [override]
|
||||
src/documents/serialisers.py:0: error: Argument 1 to "__get__" of "BaseManager" has incompatible type "PrimaryKeyRelatedField[Any]"; expected "Options[Any] | None" [arg-type]
|
||||
src/documents/serialisers.py:0: error: Argument 1 to "__get__" of "BaseManager" has incompatible type "PrimaryKeyRelatedField[Any]"; expected "Options[Any] | None" [arg-type]
|
||||
src/documents/serialisers.py:0: error: Argument 1 to "__get__" of "BaseManager" has incompatible type "PrimaryKeyRelatedField[Any]"; expected "Options[Any] | None" [arg-type]
|
||||
src/documents/serialisers.py:0: error: Argument 1 to "__get__" of "BaseManager" has incompatible type "PrimaryKeyRelatedField[Any]"; expected "Options[Any] | None" [arg-type]
|
||||
src/documents/serialisers.py:0: error: Argument 1 to "__get__" of "BaseManager" has incompatible type "PrimaryKeyRelatedField[Any]"; expected "Options[Any] | None" [arg-type]
|
||||
src/documents/serialisers.py:0: error: Argument 1 to "get_value_field_name" of "CustomFieldInstance" has incompatible type "str"; expected "FieldDataType" [arg-type]
|
||||
src/documents/serialisers.py:0: error: Argument 1 to "int" has incompatible type "Any | Collection[str]"; expected "str | Buffer | SupportsInt | SupportsIndex" [arg-type]
|
||||
src/documents/serialisers.py:0: error: Argument 1 to "int" has incompatible type "Any | Collection[str]"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc" [arg-type]
|
||||
src/documents/serialisers.py:0: error: Argument 1 to "list" has incompatible type "QuerySet[Document, TypedDict({'id': int, 'title': str, 'deleted_at': datetime | None})]"; expected "Iterable[dict[str, Any]]" [arg-type]
|
||||
src/documents/serialisers.py:0: error: Expected iterable as variadic argument [misc]
|
||||
src/documents/serialisers.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -429,11 +414,6 @@ src/documents/serialisers.py:0: error: Function is missing a return type annotat
|
||||
src/documents/serialisers.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
@@ -543,6 +523,7 @@ src/documents/serialisers.py:0: error: Function is missing a type annotation for
|
||||
src/documents/serialisers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/serialisers.py:0: error: Incompatible types in assignment (expression has type "PrimaryKeyRelatedField[Tag]", base class "Field" defined the type as "BaseSerializer[Any]") [assignment]
|
||||
src/documents/serialisers.py:0: error: Incompatible types in assignment (expression has type "Sequence[str] | tuple[Lower]", variable has type "Sequence[str] | None") [assignment]
|
||||
src/documents/serialisers.py:0: error: Incompatible types in assignment (expression has type "WorkflowActionWebhookSerializer", variable has type "WorkflowActionEmailSerializer") [assignment]
|
||||
@@ -553,8 +534,6 @@ src/documents/serialisers.py:0: error: Incompatible types in assignment (express
|
||||
src/documents/serialisers.py:0: error: Item "Field[Any, Any, Any, Any]" of "Field[Any, Any, Any, Any] | None" has no attribute "fetch_documents" [union-attr]
|
||||
src/documents/serialisers.py:0: error: Item "Field[Any, Any, Any, Any]" of "Field[Any, Any, Any, Any] | None" has no attribute "get_shared_object_pks" [union-attr]
|
||||
src/documents/serialisers.py:0: error: Item "Field[Any, Any, Any, Any]" of "Field[Any, Any, Any, Any] | None" has no attribute "get_shared_object_pks" [union-attr]
|
||||
src/documents/serialisers.py:0: error: Item "None" of "Any | None" has no attribute "name" [union-attr]
|
||||
src/documents/serialisers.py:0: error: Item "None" of "Any | None" has no attribute "pk" [union-attr]
|
||||
src/documents/serialisers.py:0: error: Item "None" of "CustomField | None" has no attribute "name" [union-attr]
|
||||
src/documents/serialisers.py:0: error: Item "None" of "Field[Any, Any, Any, Any] | None" has no attribute "context" [union-attr]
|
||||
src/documents/serialisers.py:0: error: Item "None" of "Field[Any, Any, Any, Any] | None" has no attribute "context" [union-attr]
|
||||
@@ -562,15 +541,10 @@ src/documents/serialisers.py:0: error: Item "None" of "Field[Any, Any, Any, Any]
|
||||
src/documents/serialisers.py:0: error: Item "None" of "Field[Any, Any, Any, Any] | None" has no attribute "fetch_documents" [union-attr]
|
||||
src/documents/serialisers.py:0: error: Item "None" of "Field[Any, Any, Any, Any] | None" has no attribute "get_shared_object_pks" [union-attr]
|
||||
src/documents/serialisers.py:0: error: Item "None" of "Field[Any, Any, Any, Any] | None" has no attribute "get_shared_object_pks" [union-attr]
|
||||
src/documents/serialisers.py:0: error: Item "list[str]" of "Any | list[str]" has no attribute "values_list" [union-attr]
|
||||
src/documents/serialisers.py:0: error: Missing type arguments for generic type "Field" [type-arg]
|
||||
src/documents/serialisers.py:0: error: Missing type arguments for generic type "Iterable" [type-arg]
|
||||
src/documents/serialisers.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/serialisers.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/serialisers.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/serialisers.py:0: error: Need type annotation for "document" [var-annotated]
|
||||
src/documents/serialisers.py:0: error: Need type annotation for "documents" [var-annotated]
|
||||
src/documents/serialisers.py:0: error: Need type annotation for "permissions_dict" [var-annotated]
|
||||
src/documents/serialisers.py:0: error: No overload variant of "get" of "dict" matches argument types "str", "str" [call-overload]
|
||||
src/documents/serialisers.py:0: error: No overload variant of "get" of "dict" matches argument types "str", "str" [call-overload]
|
||||
src/documents/serialisers.py:0: error: No overload variant of "get" of "dict" matches argument types "str", "str" [call-overload]
|
||||
@@ -629,6 +603,7 @@ src/documents/signals/handlers.py:0: error: Item "ConsumableDocument" of "Docume
|
||||
src/documents/signals/handlers.py:0: error: Item "None" of "Any | None" has no attribute "get" [union-attr]
|
||||
src/documents/signals/handlers.py:0: error: Item "None" of "Any | None" has no attribute "get" [union-attr]
|
||||
src/documents/signals/handlers.py:0: error: Item "None" of "Any | None" has no attribute "remove" [union-attr]
|
||||
src/documents/signals/handlers.py:0: error: Item "None" of "BaseChannelLayer | None" has no attribute "group_send" [union-attr]
|
||||
src/documents/signals/handlers.py:0: error: Item "None" of "Path | Any | None" has no attribute "is_file" [union-attr]
|
||||
src/documents/signals/handlers.py:0: error: Item "None" of "Path | Any | None" has no attribute "is_file" [union-attr]
|
||||
src/documents/signals/handlers.py:0: error: Item "None" of "Path | Any | None" has no attribute "is_file" [union-attr]
|
||||
@@ -673,11 +648,11 @@ src/documents/templating/filepath.py:0: error: Function is missing a type annota
|
||||
src/documents/templating/filepath.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/templating/filepath.py:0: error: Incompatible types in assignment (expression has type "QuerySet[Tag, Tag]", variable has type "list[Tag]") [assignment]
|
||||
src/documents/templating/filepath.py:0: error: Need type annotation for "field_data" [var-annotated]
|
||||
src/documents/templating/filters.py:0: error: Incompatible types in assignment (expression has type "date | None", variable has type "str | datetime") [assignment]
|
||||
src/documents/templating/filters.py:0: error: Incompatible types in assignment (expression has type "datetime | None", variable has type "date | datetime | str") [assignment]
|
||||
src/documents/templating/filters.py:0: error: Item "str" of "str | datetime" has no attribute "strftime" [union-attr]
|
||||
src/documents/templating/utils.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/templating/workflows.py:0: error: Argument 1 to "update" of "MutableMapping" has incompatible type "dict[str, dict[str, dict[str, str]]]"; expected "SupportsKeysAndGetItem[str, str]" [arg-type]
|
||||
src/documents/templating/workflows.py:0: error: Incompatible return value type (got "None", expected "str") [return-value]
|
||||
src/documents/tests/export/test_sinks.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/tests/management/test_management_base_cmd.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/management/test_management_base_cmd.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/management/test_management_base_cmd.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -716,6 +691,7 @@ src/documents/tests/search/test_acceptance.py:0: error: Function is missing a ty
|
||||
src/documents/tests/search/test_acceptance.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/search/test_backend.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/search/test_backend.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/search/test_backend.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/search/test_backend.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/search/test_backend.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/search/test_cjk_clause.py:0: error: Argument 1 to "_build_cjk_query" has incompatible type "None"; expected "Index" [arg-type]
|
||||
@@ -790,6 +766,8 @@ src/documents/tests/test_api_bulk_download.py:0: error: Argument 1 to "read_stre
|
||||
src/documents/tests/test_api_bulk_download.py:0: error: Value of type variable "_StrPathT" of "copy" cannot be "Path | None" [type-var]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: "type[MatchingModel]" has no attribute "objects" [attr-defined]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: "type[MatchingModel]" has no attribute "objects" [attr-defined]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -845,6 +823,12 @@ src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type a
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/tests/test_api_bulk_edit.py:0: error: Skipping analyzing "auditlog.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/tests/test_api_chat.py:0: error: "_MonkeyPatchedResponse" has no attribute "streaming_content" [attr-defined]
|
||||
src/documents/tests/test_api_custom_fields.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -853,6 +837,13 @@ src/documents/tests/test_api_document_versions.py:0: error: Argument 1 to "read_
|
||||
src/documents/tests/test_api_document_versions.py:0: error: Argument 1 to "read_streaming_response" has incompatible type "_MonkeyPatchedResponse"; expected "StreamingHttpResponse" [arg-type]
|
||||
src/documents/tests/test_api_document_versions.py:0: error: Argument 1 to "read_streaming_response" has incompatible type "_MonkeyPatchedResponse"; expected "StreamingHttpResponse" [arg-type]
|
||||
src/documents/tests/test_api_document_versions.py:0: error: Argument 1 to "read_streaming_response" has incompatible type "_MonkeyPatchedResponse"; expected "StreamingHttpResponse" [arg-type]
|
||||
src/documents/tests/test_api_document_versions.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_document_versions.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_document_versions.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_document_versions.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_document_versions.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_document_versions.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_document_versions.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_documents.py:0: error: "None" object is not iterable [misc]
|
||||
src/documents/tests/test_api_documents.py:0: error: "object" has no attribute "get" [attr-defined]
|
||||
src/documents/tests/test_api_documents.py:0: error: Argument 1 to "Path" has incompatible type "Path | None"; expected "str | PathLike[str]" [arg-type]
|
||||
@@ -888,6 +879,7 @@ src/documents/tests/test_api_email.py:0: error: Function is missing a type annot
|
||||
src/documents/tests/test_api_email.py:0: error: Item "None" of "Path | None" has no attribute "stat" [union-attr]
|
||||
src/documents/tests/test_api_email.py:0: error: Value of type variable "_StrPathT" of "copy" cannot be "Path | None" [type-var]
|
||||
src/documents/tests/test_api_filter_by_custom_fields.py:0: error: Argument 1 to "quote" has incompatible type "str | None"; expected "str" [arg-type]
|
||||
src/documents/tests/test_api_filter_by_custom_fields.py:0: error: Cannot infer type of lambda [misc]
|
||||
src/documents/tests/test_api_filter_by_custom_fields.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_filter_by_custom_fields.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_filter_by_custom_fields.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -900,6 +892,13 @@ src/documents/tests/test_api_objects.py:0: error: Function is missing a type ann
|
||||
src/documents/tests/test_api_objects.py:0: error: Item "Group" of "Group | dict[Any, Any]" has no attribute "count" [union-attr]
|
||||
src/documents/tests/test_api_objects.py:0: error: Item "dict[Any, Any]" of "Group | dict[Any, Any]" has no attribute "count" [union-attr]
|
||||
src/documents/tests/test_api_objects.py:0: error: Too few arguments for "count" of "list" [call-arg]
|
||||
src/documents/tests/test_api_ocr_templates.py:0: error: "Response" has no attribute "json" [attr-defined]
|
||||
src/documents/tests/test_api_ocr_templates.py:0: error: "Response" has no attribute "json" [attr-defined]
|
||||
src/documents/tests/test_api_ocr_templates.py:0: error: "Response" has no attribute "json" [attr-defined]
|
||||
src/documents/tests/test_api_ocr_templates.py:0: error: Argument 1 to "save" of "Image" has incompatible type "Path | None"; expected "str | bytes | PathLike[str] | PathLike[bytes] | IO[bytes]" [arg-type]
|
||||
src/documents/tests/test_api_ocr_templates.py:0: error: Incompatible types in assignment (expression has type "Response", variable has type "_MonkeyPatchedResponse") [assignment]
|
||||
src/documents/tests/test_api_ocr_templates.py:0: error: Incompatible types in assignment (expression has type "Response", variable has type "_MonkeyPatchedResponse") [assignment]
|
||||
src/documents/tests/test_api_ocr_templates.py:0: error: Item "None" of "OcrTemplateZone | None" has no attribute "name" [union-attr]
|
||||
src/documents/tests/test_api_permissions.py:0: error: Argument 2 to "get_perms" has incompatible type "Tag | None"; expected "Model" [arg-type]
|
||||
src/documents/tests/test_api_permissions.py:0: error: Argument 2 to "get_perms" has incompatible type "Tag | None"; expected "Model" [arg-type]
|
||||
src/documents/tests/test_api_permissions.py:0: error: Argument 2 to "has_perm" of "ObjectPermissionChecker" has incompatible type "Tag | None"; expected "Model" [arg-type]
|
||||
@@ -927,6 +926,9 @@ src/documents/tests/test_api_profile.py:0: error: Function is missing a type ann
|
||||
src/documents/tests/test_api_profile.py:0: error: Item "None" of "Token | None" has no attribute "key" [union-attr]
|
||||
src/documents/tests/test_api_profile.py:0: error: Skipping analyzing "allauth.mfa.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/tests/test_api_profile.py:0: error: Skipping analyzing "allauth.socialaccount.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/tests/test_api_release_notes.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_api_release_notes.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/tests/test_api_release_notes.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/tests/test_api_schema.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_schema.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_schema.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -954,6 +956,7 @@ src/documents/tests/test_api_schema.py:0: error: Value of type "SchemaGenerator"
|
||||
src/documents/tests/test_api_schema.py:0: error: Value of type "SchemaGenerator" is not indexable [index]
|
||||
src/documents/tests/test_api_schema.py:0: error: Value of type "SchemaGenerator" is not indexable [index]
|
||||
src/documents/tests/test_api_schema.py:0: error: Value of type "SchemaGenerator" is not indexable [index]
|
||||
src/documents/tests/test_api_schema.py:0: error: Value of type "SchemaGenerator" is not indexable [index]
|
||||
src/documents/tests/test_api_search.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_search.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_api_search.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -988,7 +991,14 @@ src/documents/tests/test_barcodes.py:0: error: "GetReaderPluginMixin" has no att
|
||||
src/documents/tests/test_barcodes.py:0: error: Argument 1 to "contextmanager" has incompatible type "Callable[[TestAsnBarcode, Path], BarcodePlugin]"; expected "Callable[[TestAsnBarcode, Path], Iterator[Never]]" [arg-type]
|
||||
src/documents/tests/test_barcodes.py:0: error: Argument 1 to "contextmanager" has incompatible type "Callable[[TestTagBarcode, Path], BarcodePlugin]"; expected "Callable[[TestTagBarcode, Path], Iterator[Never]]" [arg-type]
|
||||
src/documents/tests/test_barcodes.py:0: error: Argument 1 to "get_reader" of "GetReaderPluginMixin" has incompatible type "str"; expected "Path" [arg-type]
|
||||
src/documents/tests/test_barcodes.py:0: error: Argument 1 to "list" has incompatible type "QuerySet[DocumentBarcode, TypedDict({'page': int, 'value': str, 'format': str})]"; expected "Iterable[dict[Any, Any]]" [arg-type]
|
||||
src/documents/tests/test_barcodes.py:0: error: Incompatible types in assignment (expression has type "Path", variable has type "str") [assignment]
|
||||
src/documents/tests/test_barcodes.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/tests/test_barcodes.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/tests/test_barcodes.py:0: error: Missing type arguments for generic type "list" [type-arg]
|
||||
src/documents/tests/test_barcodes.py:0: error: Need type annotation for "reader" [var-annotated]
|
||||
src/documents/tests/test_barcodes.py:0: error: Need type annotation for "reader" [var-annotated]
|
||||
src/documents/tests/test_barcodes.py:0: error: Need type annotation for "reader" [var-annotated]
|
||||
src/documents/tests/test_barcodes.py:0: error: Need type annotation for "reader" [var-annotated]
|
||||
src/documents/tests/test_barcodes.py:0: error: Need type annotation for "reader" [var-annotated]
|
||||
src/documents/tests/test_barcodes.py:0: error: Need type annotation for "reader" [var-annotated]
|
||||
@@ -1014,7 +1024,8 @@ src/documents/tests/test_bulk_edit.py:0: error: Argument 2 to "set_document_type
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Argument 2 to "set_storage_path" has incompatible type "None"; expected "StoragePath" [arg-type]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Argument 2 to "set_storage_path" has incompatible type "int"; expected "StoragePath" [arg-type]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Argument 2 to "set_storage_path" has incompatible type "int"; expected "StoragePath" [arg-type]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Dict entry 0 has incompatible type "Literal['not_a_real_action']": "PermissionGranteesUpdate"; expected "Literal['view', 'change']": "PermissionGranteesUpdate" [dict-item]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Dict entry 1 has incompatible type "Literal['not_a_real_action']": "PermissionGranteesUpdate"; expected "Literal['view', 'change']": "PermissionGranteesUpdate" [dict-item]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -1060,6 +1071,34 @@ src/documents/tests/test_bulk_edit.py:0: error: Item "dict[Any, Any]" of "Group
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Too few arguments for "count" of "list" [call-arg]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Too few arguments for "count" of "list" [call-arg]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Too few arguments for "count" of "list" [call-arg]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Unused "type: ignore" comment [unused-ignore]
|
||||
src/documents/tests/test_bulk_edit.py:0: error: Unused "type: ignore" comment [unused-ignore]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Item "None" of "BaseChannelLayer | None" has no attribute "group_send" [union-attr]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Skipping analyzing "auditlog.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: TypedDict "_WebsocketTestScope" has no key "user" [typeddict-unknown-key]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: TypedDict "_WebsocketTestScope" has no key "user" [typeddict-unknown-key]
|
||||
src/documents/tests/test_bulk_operations.py:0: error: Value of type "Any | None" is not indexable [index]
|
||||
src/documents/tests/test_classifier.py:0: error: "None" has no attribute "classes_" [attr-defined]
|
||||
src/documents/tests/test_classifier.py:0: error: "None" has no attribute "classes_" [attr-defined]
|
||||
src/documents/tests/test_classifier.py:0: error: "None" has no attribute "classes_" [attr-defined]
|
||||
@@ -1157,6 +1196,7 @@ src/documents/tests/test_consumer_archive.py:0: error: Function is missing a typ
|
||||
src/documents/tests/test_consumer_archive.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_consumer_archive.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_consumer_archive.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_consumer_zone_ocr.py:0: error: Module "pytest_django.fixtures" has no attribute "SettingsWrapper" [attr-defined]
|
||||
src/documents/tests/test_document_list_effective_content_annotation.py:0: error: Incompatible types in assignment (expression has type "SimpleNamespace", variable has type "Request") [assignment]
|
||||
src/documents/tests/test_document_list_effective_content_annotation.py:0: error: Incompatible types in assignment (expression has type "SimpleNamespace", variable has type "Request") [assignment]
|
||||
src/documents/tests/test_double_sided.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -1249,6 +1289,8 @@ src/documents/tests/test_matchables.py:0: error: Missing type arguments for gene
|
||||
src/documents/tests/test_matchables.py:0: error: Missing type arguments for generic type "DjangoModelFactory" [type-arg]
|
||||
src/documents/tests/test_matchables.py:0: error: Missing type arguments for generic type "DjangoModelFactory" [type-arg]
|
||||
src/documents/tests/test_matchables.py:0: error: Missing type arguments for generic type "DjangoModelFactory" [type-arg]
|
||||
src/documents/tests/test_merge_documents_as_versions.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_merge_documents_as_versions.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_merge_documents_as_versions.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_merge_documents_as_versions.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_merge_documents_as_versions.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -1273,11 +1315,14 @@ src/documents/tests/test_models.py:0: error: Item "None" of "Document | None" ha
|
||||
src/documents/tests/test_parsers.py:0: error: "None" not callable [misc]
|
||||
src/documents/tests/test_parsers.py:0: error: "None" not callable [misc]
|
||||
src/documents/tests/test_parsers.py:0: error: "None" not callable [misc]
|
||||
src/documents/tests/test_parsers.py:0: error: "None" object is not iterable [misc]
|
||||
src/documents/tests/test_parsers.py:0: error: "float" object is not iterable [misc]
|
||||
src/documents/tests/test_permission_filtering_security.py:0: error: Argument "classifier" to "match_correspondents" has incompatible type "None"; expected "DocumentClassifier" [arg-type]
|
||||
src/documents/tests/test_permission_filtering_security.py:0: error: Argument "classifier" to "match_document_types" has incompatible type "None"; expected "DocumentClassifier" [arg-type]
|
||||
src/documents/tests/test_permission_filtering_security.py:0: error: Argument "classifier" to "match_storage_paths" has incompatible type "None"; expected "DocumentClassifier" [arg-type]
|
||||
src/documents/tests/test_permission_filtering_security.py:0: error: Argument "classifier" to "match_tags" has incompatible type "None"; expected "DocumentClassifier" [arg-type]
|
||||
src/documents/tests/test_permission_filtering_security.py:0: error: Argument 1 to "permitted_document_ids" has incompatible type "AnonymousUser"; expected "User | None" [arg-type]
|
||||
src/documents/tests/test_permission_filtering_security.py:0: error: Argument 1 to "permitted_document_ids" has incompatible type "AnonymousUser"; expected "User | None" [arg-type]
|
||||
src/documents/tests/test_permission_filtering_security.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_permission_filtering_security.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_permission_filtering_security.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -1331,10 +1376,12 @@ src/documents/tests/test_share_link_bundles.py:0: error: "_MonkeyPatchedResponse
|
||||
src/documents/tests/test_share_link_bundles.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_share_link_bundles.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_share_link_bundles.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_share_link_bundles.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_tag_adjacency.py:0: error: "Model" has no attribute "name" [attr-defined]
|
||||
src/documents/tests/test_tag_adjacency.py:0: error: "Model" has no attribute "tn_parent_id" [attr-defined]
|
||||
src/documents/tests/test_tag_hierarchy.py:0: error: Argument 1 to "run_workflows" has incompatible type "int"; expected "WorkflowTriggerType" [arg-type]
|
||||
src/documents/tests/test_tag_hierarchy.py:0: error: Argument 1 to "run_workflows" has incompatible type "int"; expected "WorkflowTriggerType" [arg-type]
|
||||
src/documents/tests/test_tag_hierarchy.py:0: error: Argument 2 to "get" of "APIClient" has incompatible type "dict[str, object]"; expected "Mapping[str, str | bytes | float | Iterable[str | bytes | float]] | Iterable[tuple[str, str | bytes | float | Iterable[str | bytes | float]]] | None" [arg-type]
|
||||
src/documents/tests/test_tag_hierarchy.py:0: error: Incompatible types in assignment (expression has type "Literal[204, 200]", variable has type "Literal[403]") [assignment]
|
||||
src/documents/tests/test_tag_hierarchy.py:0: error: Need type annotation for "context" (hint: "context: dict[<type>, <type>] = ...") [var-annotated]
|
||||
src/documents/tests/test_task_signals.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/tests/test_task_signals.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -1344,6 +1391,7 @@ src/documents/tests/test_task_signals.py:0: error: Function is missing a type an
|
||||
src/documents/tests/test_task_signals.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_task_signals.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_task_signals.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_task_signals.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_task_signals.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/tests/test_task_signals.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/tests/test_task_signals.py:0: error: Missing type arguments for generic type "tuple" [type-arg]
|
||||
@@ -1359,6 +1407,8 @@ src/documents/tests/test_tasks.py:0: error: Function is missing a type annotatio
|
||||
src/documents/tests/test_tasks.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_tasks.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_tasks.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_utils.py:0: error: "ImageFile" has no attribute "n_frames"; maybe "_min_frame"? [attr-defined]
|
||||
src/documents/tests/test_utils.py:0: error: "ImageFile" has no attribute "n_frames"; maybe "_min_frame"? [attr-defined]
|
||||
src/documents/tests/test_views.py:0: error: "_MonkeyPatchedWSGIResponse" has no attribute "render" [attr-defined]
|
||||
src/documents/tests/test_views.py:0: error: "_MonkeyPatchedWSGIResponse" has no attribute "render" [attr-defined]
|
||||
src/documents/tests/test_views.py:0: error: "_MonkeyPatchedWSGIResponse" has no attribute "url" [attr-defined]
|
||||
@@ -1440,6 +1490,10 @@ src/documents/tests/test_workflows.py:0: error: Argument 2 to "assertIn" of "Tes
|
||||
src/documents/tests/test_workflows.py:0: error: Argument 2 to "assertIn" of "TestCase" has incompatible type "str | None"; expected "Iterable[Any] | Container[Any]" [arg-type]
|
||||
src/documents/tests/test_workflows.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_workflows.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_workflows.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_workflows.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/tests/test_workflows.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_workflows.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_workflows.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_workflows.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/tests/test_workflows.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -1494,6 +1548,8 @@ src/documents/tests/test_workflows.py:0: error: Item "None" of "Request | None"
|
||||
src/documents/tests/test_workflows.py:0: error: Item "None" of "Request | None" has no attribute "headers" [union-attr]
|
||||
src/documents/tests/test_workflows.py:0: error: Item "None" of "Request | None" has no attribute "headers" [union-attr]
|
||||
src/documents/tests/test_workflows.py:0: error: Item "None" of "Request | None" has no attribute "url" [union-attr]
|
||||
src/documents/tests/test_workflows.py:0: error: Item "None" of "WorkflowActionWebhook | None" has no attribute "params" [union-attr]
|
||||
src/documents/tests/test_workflows.py:0: error: Item "None" of "WorkflowActionWebhook | None" has no attribute "use_params" [union-attr]
|
||||
src/documents/tests/test_workflows.py:0: error: Item "str" of "Path | str" has no attribute "name" [union-attr]
|
||||
src/documents/tests/test_workflows.py:0: error: Name "group_perms" already defined on line 0 [no-redef]
|
||||
src/documents/tests/test_workflows.py:0: error: Name "group_perms" already defined on line 0 [no-redef]
|
||||
@@ -1510,6 +1566,15 @@ src/documents/tests/test_workflows.py:0: error: Too few arguments for "count" of
|
||||
src/documents/tests/test_workflows.py:0: error: Too few arguments for "count" of "list" [call-arg]
|
||||
src/documents/tests/test_workflows.py:0: error: Too few arguments for "count" of "list" [call-arg]
|
||||
src/documents/tests/test_workflows.py:0: error: Too few arguments for "count" of "list" [call-arg]
|
||||
src/documents/tests/test_zone_ocr.py:0: error: Item "None" of "Image | None" has no attribute "__enter__" [union-attr]
|
||||
src/documents/tests/test_zone_ocr.py:0: error: Item "None" of "Image | None" has no attribute "__enter__" [union-attr]
|
||||
src/documents/tests/test_zone_ocr.py:0: error: Item "None" of "Image | None" has no attribute "__enter__" [union-attr]
|
||||
src/documents/tests/test_zone_ocr.py:0: error: Item "None" of "Image | None" has no attribute "__enter__" [union-attr]
|
||||
src/documents/tests/test_zone_ocr.py:0: error: Item "None" of "Image | None" has no attribute "__exit__" [union-attr]
|
||||
src/documents/tests/test_zone_ocr.py:0: error: Item "None" of "Image | None" has no attribute "__exit__" [union-attr]
|
||||
src/documents/tests/test_zone_ocr.py:0: error: Item "None" of "Image | None" has no attribute "__exit__" [union-attr]
|
||||
src/documents/tests/test_zone_ocr.py:0: error: Item "None" of "Image | None" has no attribute "__exit__" [union-attr]
|
||||
src/documents/tests/test_zone_ocr.py:0: error: Module "pytest_django.fixtures" has no attribute "SettingsWrapper" [attr-defined]
|
||||
src/documents/tests/utils.py:0: error: "GetConsumerMixin" has no attribute "dirs" [attr-defined]
|
||||
src/documents/tests/utils.py:0: error: "GetConsumerMixin" has no attribute "dirs" [attr-defined]
|
||||
src/documents/tests/utils.py:0: error: "GetConsumerMixin" has no attribute "dirs" [attr-defined]
|
||||
@@ -1523,27 +1588,28 @@ src/documents/utils.py:0: error: Incompatible types in assignment (expression ha
|
||||
src/documents/utils.py:0: error: Missing type arguments for generic type "CompletedProcess" [type-arg]
|
||||
src/documents/validators.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/versioning.py:0: error: Missing type arguments for generic type "Prefetch" [type-arg]
|
||||
src/documents/versioning.py:0: error: Type argument "int" of "QuerySet" must be a subtype of "Model" [type-var]
|
||||
src/documents/views.py:0: error: "BulkPermissionMixin" has no attribute "filter_queryset" [attr-defined]
|
||||
src/documents/views.py:0: error: "BulkPermissionMixin" has no attribute "get_queryset" [attr-defined]
|
||||
src/documents/views.py:0: error: "BulkPermissionMixin" has no attribute "queryset" [attr-defined]
|
||||
src/documents/views.py:0: error: "BulkPermissionMixin" has no attribute "queryset" [attr-defined]
|
||||
src/documents/views.py:0: error: "Sequence[_SupportsHasPermission]" has no attribute "append" [attr-defined]
|
||||
src/documents/views.py:0: error: "get_serializer_context" undefined in superclass [misc]
|
||||
src/documents/views.py:0: error: "object" has no attribute "apply_async" [attr-defined]
|
||||
src/documents/views.py:0: error: "type[DocumentFilterSet]" has no attribute "base_filters" [attr-defined]
|
||||
src/documents/views.py:0: error: "type[DocumentFilterSet]" has no attribute "declared_filters" [attr-defined]
|
||||
src/documents/views.py:0: error: "type[Model]" has no attribute "objects" [attr-defined]
|
||||
src/documents/views.py:0: error: Argument "filename" to "FileResponse" has incompatible type "str | Any | None"; expected "str" [arg-type]
|
||||
src/documents/views.py:0: error: Argument "path" to "EmailAttachment" has incompatible type "Path | None"; expected "Path" [arg-type]
|
||||
src/documents/views.py:0: error: Argument "user" to "_has_document_permissions" of "DocumentOperationPermissionMixin" has incompatible type "User | AnonymousUser"; expected "User" [arg-type]
|
||||
src/documents/views.py:0: error: Argument "user" to "_has_document_permissions" of "DocumentOperationPermissionMixin" has incompatible type "User | AnonymousUser"; expected "User" [arg-type]
|
||||
src/documents/views.py:0: error: Argument "user" to "_resolve_document_ids" of "DocumentSelectionMixin" has incompatible type "User | AnonymousUser"; expected "User" [arg-type]
|
||||
src/documents/views.py:0: error: Argument "user" to "_resolve_document_ids" of "DocumentSelectionMixin" has incompatible type "User | AnonymousUser"; expected "User" [arg-type]
|
||||
src/documents/views.py:0: error: Argument "user" to "has_document_operation_permissions" has incompatible type "User | AnonymousUser"; expected "User" [arg-type]
|
||||
src/documents/views.py:0: error: Argument "user" to "has_document_operation_permissions" has incompatible type "User | AnonymousUser"; expected "User" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 1 to "TaskSummarySerializer" has incompatible type "QuerySet[PaperlessTask@AnnotatedWith[TypedDict({'total_count': int, 'pending_count': int, 'success_count': int, 'failure_count': int, 'avg_duration_seconds': Any, 'avg_wait_time_seconds': Any, 'last_run': Any, 'last_success': Any, 'last_failure': Any})], TypedDict({'task_type': str, 'total_count': Any, 'pending_count': Any, 'success_count': Any, 'failure_count': Any, 'avg_duration_seconds': Any, 'avg_wait_time_seconds': Any, 'last_run': Any, 'last_success': Any, 'last_failure': Any})]"; expected "dict[str, Any] | None" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 1 to "int" has incompatible type "Any | Collection[str]"; expected "str | Buffer | SupportsInt | SupportsIndex" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 1 to "int" has incompatible type "Any | Collection[str]"; expected "str | Buffer | SupportsInt | SupportsIndex" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 1 to "int" has incompatible type "Any | Collection[str]"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 1 to "int" has incompatible type "Any | Collection[str]"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 1 to "paginate_queryset" of "GenericAPIView" has incompatible type "TantivyRelevanceList"; expected "QuerySet[Any, _MT_co] | Sequence[_MT_co]" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 1 to "permitted_document_ids" has incompatible type "User | AnonymousUser"; expected "User | None" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 1 to "permitted_object_ids" has incompatible type "User | AnonymousUser"; expected "User | None" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 1 to "permitted_object_ids" has incompatible type "User | AnonymousUser"; expected "User | None" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 2 to "match_correspondents" has incompatible type "DocumentClassifier | None"; expected "DocumentClassifier" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 2 to "match_document_types" has incompatible type "DocumentClassifier | None"; expected "DocumentClassifier" [arg-type]
|
||||
src/documents/views.py:0: error: Argument 2 to "match_storage_paths" has incompatible type "DocumentClassifier | None"; expected "DocumentClassifier" [arg-type]
|
||||
@@ -1569,6 +1635,10 @@ src/documents/views.py:0: error: Function is missing a return type annotation [
|
||||
src/documents/views.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
@@ -1637,7 +1707,6 @@ src/documents/views.py:0: error: Function is missing a type annotation [no-unty
|
||||
src/documents/views.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/views.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -1669,9 +1738,8 @@ src/documents/views.py:0: error: Item "None" of "Any | None" has no attribute "g
|
||||
src/documents/views.py:0: error: Item "None" of "ApplicationConfiguration | None" has no attribute "app_logo" [union-attr]
|
||||
src/documents/views.py:0: error: Item "None" of "BasePagination | None" has no attribute "get_page_size" [union-attr]
|
||||
src/documents/views.py:0: error: Item "None" of "BasePagination | None" has no attribute "page_size" [union-attr]
|
||||
src/documents/views.py:0: error: Missing positional argument "request" in call to "email_documents" [call-arg]
|
||||
src/documents/views.py:0: error: Missing type arguments for generic type "GenericViewSet" [type-arg]
|
||||
src/documents/views.py:0: error: Missing type arguments for generic type "list" [type-arg]
|
||||
src/documents/views.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/views.py:0: error: Missing type arguments for generic type "list" [type-arg]
|
||||
src/documents/views.py:0: error: Missing type arguments for generic type "list" [type-arg]
|
||||
src/documents/views.py:0: error: Missing type arguments for generic type "list" [type-arg]
|
||||
@@ -1686,17 +1754,18 @@ src/documents/views.py:0: error: No overload variant of "prefetch_related" of "Q
|
||||
src/documents/views.py:0: error: Skipping analyzing "auditlog.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/views.py:0: error: Skipping analyzing "langdetect": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/documents/views.py:0: error: Unsupported operand types for + ("None" and "int") [operator]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[Any]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[Any]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[Any]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[Any]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[Any]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[Any]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[Any]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[Correspondent]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[CustomField]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[DocumentType]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[Group]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[MailAccount]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[MailRule]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[SavedView]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[StoragePath]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[Tag]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[User]" is not indexable [index]
|
||||
src/documents/views.py:0: error: Value of type "Iterable[Workflow]" is not indexable [index]
|
||||
src/documents/workflows/actions.py:0: error: Argument 1 to "get_value_field_name" of "CustomFieldInstance" has incompatible type "str"; expected "FieldDataType" [arg-type]
|
||||
src/documents/workflows/actions.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/workflows/actions.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/documents/workflows/actions.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -1716,6 +1785,8 @@ src/documents/workflows/actions.py:0: error: Item "ConsumableDocument" of "Docum
|
||||
src/documents/workflows/actions.py:0: error: Item "ConsumableDocument" of "Document | ConsumableDocument" has no attribute "pk" [union-attr]
|
||||
src/documents/workflows/actions.py:0: error: Item "ConsumableDocument" of "Document | ConsumableDocument" has no attribute "pk" [union-attr]
|
||||
src/documents/workflows/actions.py:0: error: Item "ConsumableDocument" of "Document | ConsumableDocument" has no attribute "title" [union-attr]
|
||||
src/documents/workflows/actions.py:0: error: Item "None" of "DocumentMetadataOverrides | None" has no attribute "custom_fields" [union-attr]
|
||||
src/documents/workflows/actions.py:0: error: Item "None" of "DocumentMetadataOverrides | None" has no attribute "custom_fields" [union-attr]
|
||||
src/documents/workflows/actions.py:0: error: Item "None" of "WorkflowActionEmail | None" has no attribute "body" [union-attr]
|
||||
src/documents/workflows/actions.py:0: error: Item "None" of "WorkflowActionEmail | None" has no attribute "body" [union-attr]
|
||||
src/documents/workflows/actions.py:0: error: Item "None" of "WorkflowActionEmail | None" has no attribute "include_document" [union-attr]
|
||||
@@ -1737,6 +1808,7 @@ src/documents/workflows/actions.py:0: error: Item "None" of "WorkflowActionWebho
|
||||
src/documents/workflows/actions.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/workflows/actions.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/workflows/actions.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/documents/workflows/actions.py:0: error: Value of type "dict[Any, Any] | Any | None" is not indexable [index]
|
||||
src/documents/workflows/ai.py:0: error: "type[ObjT]" has no attribute "objects" [attr-defined]
|
||||
src/documents/workflows/ai.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/workflows/mutations.py:0: error: "WorkflowAction" has no attribute "has_assign_change_groups"; maybe "assign_change_groups"? [attr-defined]
|
||||
@@ -1769,7 +1841,6 @@ src/documents/workflows/mutations.py:0: error: Function is missing a return type
|
||||
src/documents/workflows/mutations.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/documents/workflows/mutations.py:0: error: Item "None" of "Any | None" has no attribute "get" [union-attr]
|
||||
src/documents/workflows/mutations.py:0: error: Item "None" of "Any | None" has no attribute "get" [union-attr]
|
||||
src/documents/workflows/mutations.py:0: error: Need type annotation for "permissions" [var-annotated]
|
||||
src/documents/workflows/utils.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/documents/workflows/webhooks.py:0: error: Argument 1 to "post" of "Client" has incompatible type "**dict[str, str | dict[Any, Any] | None]"; expected "Cookies | CookieJar | dict[str, str] | list[tuple[str, str]] | None" [arg-type]
|
||||
src/documents/workflows/webhooks.py:0: error: Argument 1 to "post" of "Client" has incompatible type "**dict[str, str | dict[Any, Any] | None]"; expected "Headers | Mapping[str, str] | Mapping[bytes, bytes] | Sequence[tuple[str, str]] | Sequence[tuple[bytes, bytes]] | None" [arg-type]
|
||||
@@ -1792,10 +1863,12 @@ src/paperless/adapter.py:0: error: Function is missing a type annotation [no-un
|
||||
src/paperless/adapter.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/adapter.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/adapter.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/adapter.py:0: error: Missing type arguments for generic type "tuple" [type-arg]
|
||||
src/paperless/adapter.py:0: error: Name "user" already defined on line 0 [no-redef]
|
||||
src/paperless/adapter.py:0: error: Skipping analyzing "allauth.account.adapter": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/adapter.py:0: error: Skipping analyzing "allauth.core": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/adapter.py:0: error: Skipping analyzing "allauth.headless.tokens.strategies.sessions": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/adapter.py:0: error: Skipping analyzing "allauth.mfa.stages": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/adapter.py:0: error: Skipping analyzing "allauth.socialaccount.adapter": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/admin.py:0: error: "PaperlessUserForm" has no attribute "request" [attr-defined]
|
||||
src/paperless/admin.py:0: error: "type[ModelForm[Any]]" has no attribute "request" [attr-defined]
|
||||
@@ -1851,12 +1924,17 @@ src/paperless/consumers.py:0: error: Argument 1 to "_can_view" of "StatusConsume
|
||||
src/paperless/consumers.py:0: error: Item "AbstractBaseUser" of "AbstractBaseUser | AnonymousUser" has no attribute "groups" [union-attr]
|
||||
src/paperless/consumers.py:0: error: Item "AbstractBaseUser" of "AbstractBaseUser | AnonymousUser" has no attribute "id" [union-attr]
|
||||
src/paperless/consumers.py:0: error: Item "AbstractBaseUser" of "AbstractBaseUser | AnonymousUser" has no attribute "is_superuser" [union-attr]
|
||||
src/paperless/consumers.py:0: error: Item "None" of "UserLazyObject | None" has no attribute "id" [union-attr]
|
||||
src/paperless/consumers.py:0: error: Item "None" of "UserLazyObject | None" has no attribute "id" [union-attr]
|
||||
src/paperless/consumers.py:0: error: Missing type arguments for generic type "Task" [type-arg]
|
||||
src/paperless/consumers.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/paperless/consumers.py:0: error: Unsupported operand types for in ("Any | None" and "list[int]") [operator]
|
||||
src/paperless/db_cache.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/db_cache.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/db_cache.py:0: error: Skipping analyzing "cachalot.api": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/db_cache.py:0: error: Skipping analyzing "cachalot.utils": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/fields.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/fields.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless/middleware.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/middleware.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/middleware.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
@@ -1878,6 +1956,7 @@ src/paperless/parsers/tesseract.py:0: error: Missing type arguments for generic
|
||||
src/paperless/parsers/tesseract.py:0: error: Skipping analyzing "img2pdf": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/serialisers.py:0: error: "PasswordValidationMixin" has no attribute "instance" [attr-defined]
|
||||
src/paperless/serialisers.py:0: error: "UploadedFile[Any]" has no attribute "field_name" [attr-defined]
|
||||
src/paperless/serialisers.py:0: error: Argument 1 to "is_obfuscated_password" has incompatible type "str | None"; expected "str" [arg-type]
|
||||
src/paperless/serialisers.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
@@ -1887,7 +1966,6 @@ src/paperless/serialisers.py:0: error: Function is missing a type annotation [n
|
||||
src/paperless/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/serialisers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless/serialisers.py:0: error: Item "None" of "str | None" has no attribute "replace" [union-attr]
|
||||
src/paperless/serialisers.py:0: error: Missing type arguments for generic type "UploadedFile" [type-arg]
|
||||
src/paperless/serialisers.py:0: error: Missing type arguments for generic type "UploadedFile" [type-arg]
|
||||
src/paperless/serialisers.py:0: error: Need type annotation for "auth_token" [var-annotated]
|
||||
@@ -1898,7 +1976,6 @@ src/paperless/serialisers.py:0: error: Skipping analyzing "allauth.mfa.totp.inte
|
||||
src/paperless/serialisers.py:0: error: Skipping analyzing "allauth.socialaccount.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/settings/__init__.py:0: error: "Collection[str]" has no attribute "append" [attr-defined]
|
||||
src/paperless/settings/__init__.py:0: error: "Collection[str]" has no attribute "insert" [attr-defined]
|
||||
src/paperless/settings/__init__.py:0: error: Argument 1 to "append" of "list" has incompatible type "str | None"; expected "str" [arg-type]
|
||||
src/paperless/settings/__init__.py:0: error: Argument 1 to "parse_ignore_dates" has incompatible type "str | None"; expected "str" [arg-type]
|
||||
src/paperless/settings/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/settings/__init__.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -1906,6 +1983,7 @@ src/paperless/settings/__init__.py:0: error: Function is missing a return type a
|
||||
src/paperless/settings/__init__.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless/settings/__init__.py:0: error: Incompatible types in assignment (expression has type "bool", variable has type "str") [assignment]
|
||||
src/paperless/settings/__init__.py:0: error: Incompatible types in assignment (expression has type "dict[str, object]", target has type "str") [assignment]
|
||||
src/paperless/settings/__init__.py:0: error: Incompatible types in assignment (expression has type "int", target has type "Collection[str]") [assignment]
|
||||
src/paperless/settings/custom.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/paperless/settings/custom.py:0: error: No overload variant of "getenv" matches argument types "Collection[str]", "Collection[str]" [call-overload]
|
||||
src/paperless/settings/custom.py:0: error: Unpacked dict entry 0 has incompatible type "Collection[str]"; expected "SupportsKeysAndGetItem[str, dict[str, str]]" [dict-item]
|
||||
@@ -1925,8 +2003,6 @@ src/paperless/tests/parsers/test_mail_parser.py:0: error: Item "None" of "Reques
|
||||
src/paperless/tests/parsers/test_mail_parser.py:0: error: Item "None" of "Request | None" has no attribute "url" [union-attr]
|
||||
src/paperless/tests/parsers/test_mail_parser_live.py:0: error: Argument 1 to "extract_text" has incompatible type "Path | None"; expected "Path" [arg-type]
|
||||
src/paperless/tests/parsers/test_mail_parser_live.py:0: error: List item 0 has incompatible type "str | None"; expected "str | bytes | PathLike[str] | PathLike[bytes]" [list-item]
|
||||
src/paperless/tests/parsers/test_parse_modes.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/tests/parsers/test_parse_modes.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/tests/parsers/test_parse_modes.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/tests/parsers/test_parse_modes.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/tests/parsers/test_parse_modes.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "ModeChoices") [assignment]
|
||||
@@ -1987,14 +2063,21 @@ src/paperless/tests/settings/test_environment_parsers.py:0: error: Function is m
|
||||
src/paperless/tests/settings/test_environment_parsers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless/tests/settings/test_environment_parsers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless/tests/settings/test_remote_user.py:0: error: Unsupported target for indexed assignment ("Collection[str]") [index]
|
||||
src/paperless/tests/settings/test_settings.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/tests/settings/test_settings.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_adapter.py:0: error: "BaseDatabaseWrapper" has no attribute "is_in_memory_db" [attr-defined]
|
||||
src/paperless/tests/test_adapter.py:0: error: Cannot assign to a method [method-assign]
|
||||
src/paperless/tests/test_adapter.py:0: error: Cannot assign to a method [method-assign]
|
||||
src/paperless/tests/test_adapter.py:0: error: Cannot assign to a method [method-assign]
|
||||
src/paperless/tests/test_adapter.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_adapter.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_adapter.py:0: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "SessionBase") [assignment]
|
||||
src/paperless/tests/test_adapter.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/paperless/tests/test_adapter.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/paperless/tests/test_adapter.py:0: error: Skipping analyzing "allauth.account.adapter": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/tests/test_adapter.py:0: error: Skipping analyzing "allauth.account.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/tests/test_adapter.py:0: error: Skipping analyzing "allauth.core": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/tests/test_adapter.py:0: error: Skipping analyzing "allauth.mfa.totp.internal.auth": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/tests/test_adapter.py:0: error: Skipping analyzing "allauth.socialaccount.adapter": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/tests/test_adapter.py:0: error: Skipping analyzing "allauth.socialaccount.models": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless/tests/test_admin_auth.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_admin_auth.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_admin_auth.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -2005,6 +2088,10 @@ src/paperless/tests/test_api_auth.py:0: error: Function is missing a return type
|
||||
src/paperless/tests/test_api_auth.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_api_auth.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_api_auth.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_api_auth.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_api_auth.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_api_auth.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_api_auth.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_auth_middleware.py:0: error: Argument 1 to "AutoLoginMiddleware" has incompatible type "Callable[[Any], None]"; expected "_AnyGetResponseCallable" [arg-type]
|
||||
src/paperless/tests/test_auth_middleware.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_checks.py:0: error: Generator has incompatible item type "str | None"; expected "str" [misc]
|
||||
@@ -2014,6 +2101,7 @@ src/paperless/tests/test_checks.py:0: error: Unsupported right operand type for
|
||||
src/paperless/tests/test_checks.py:0: error: Unsupported right operand type for in ("str | None") [operator]
|
||||
src/paperless/tests/test_checks.py:0: error: Unsupported right operand type for in ("str | None") [operator]
|
||||
src/paperless/tests/test_checks.py:0: error: Unsupported right operand type for in ("str | None") [operator]
|
||||
src/paperless/tests/test_checks.py:0: error: Unsupported right operand type for in ("str | None") [operator]
|
||||
src/paperless/tests/test_compression_middleware.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_logging.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/tests/test_logging.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -2093,7 +2181,7 @@ src/paperless/validators.py:0: error: Argument 1 to "join" of "str" has incompat
|
||||
src/paperless/validators.py:0: error: Incompatible types in assignment (expression has type "str | bytes", variable has type "str") [assignment]
|
||||
src/paperless/validators.py:0: error: Missing type arguments for generic type "UploadedFile" [type-arg]
|
||||
src/paperless/validators.py:0: error: Missing type arguments for generic type "UploadedFile" [type-arg]
|
||||
src/paperless/views.py:0: error: Argument 1 to "int" has incompatible type "Any | Collection[str]"; expected "str | Buffer | SupportsInt | SupportsIndex" [arg-type]
|
||||
src/paperless/views.py:0: error: Argument 1 to "int" has incompatible type "Any | Collection[str]"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc" [arg-type]
|
||||
src/paperless/views.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/views.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless/views.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
@@ -2143,16 +2231,20 @@ src/paperless_ai/ai_classifier.py:0: error: Argument 1 to "parse_ai_response" ha
|
||||
src/paperless_ai/ai_classifier.py:0: error: Incompatible types in assignment (expression has type "Any | None", variable has type "str") [assignment]
|
||||
src/paperless_ai/ai_classifier.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/paperless_ai/ai_classifier.py:0: error: Missing type arguments for generic type "dict" [type-arg]
|
||||
src/paperless_ai/ai_classifier.py:0: error: TypedDict key must be a string literal; expected one of ("correspondents", "dates", "document_types", "storage_paths", "tags", ...) [literal-required]
|
||||
src/paperless_ai/ai_classifier.py:0: error: TypedDict key must be a string literal; expected one of ("correspondents", "dates", "document_types", "storage_paths", "tags", ...) [literal-required]
|
||||
src/paperless_ai/ai_classifier.py:0: error: TypedDict key must be a string literal; expected one of ("correspondents", "dates", "document_types", "storage_paths", "tags", ...) [literal-required]
|
||||
src/paperless_ai/ai_classifier.py:0: error: TypedDict key must be a string literal; expected one of ("title", "tags", "correspondents", "document_types", "storage_paths", ...) [literal-required]
|
||||
src/paperless_ai/ai_classifier.py:0: error: TypedDict key must be a string literal; expected one of ("title", "tags", "correspondents", "document_types", "storage_paths", ...) [literal-required]
|
||||
src/paperless_ai/ai_classifier.py:0: error: TypedDict key must be a string literal; expected one of ("title", "tags", "correspondents", "document_types", "storage_paths", ...) [literal-required]
|
||||
src/paperless_ai/base_model.py:0: error: Invalid index type "str | None" for "dict[str, FieldInfo]"; expected type "str" [index]
|
||||
src/paperless_ai/chat.py:0: error: Dict entry 1 has incompatible type "str": "str | Any | None"; expected "str": "int | str" [dict-item]
|
||||
src/paperless_ai/chat.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless_ai/chat.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless_ai/chat.py:0: error: Item "AsyncGenerator[str, None]" of "Any | Generator[str, None, None] | AsyncGenerator[str, None]" has no attribute "__iter__" (not iterable) [union-attr]
|
||||
src/paperless_ai/chat.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless_ai/chat.py:0: error: Incompatible return value type (got "tuple[str | None, Any | AsyncGenerator[str, None], Any | Generator[str, None, None] | AsyncGenerator[str, None]]", expected "tuple[str | None, AsyncIterator[str], AsyncIterator[str]]") [return-value]
|
||||
src/paperless_ai/chat.py:0: error: Item "Response" of "Response | StreamingResponse | AsyncStreamingResponse | PydanticResponse" has no attribute "async_response_gen" [union-attr]
|
||||
src/paperless_ai/chat.py:0: error: Item "Response" of "Response | StreamingResponse | AsyncStreamingResponse | PydanticResponse" has no attribute "response_gen" [union-attr]
|
||||
src/paperless_ai/chat.py:0: error: Item "StreamingResponse" of "Response | StreamingResponse | AsyncStreamingResponse | PydanticResponse" has no attribute "async_response_gen" [union-attr]
|
||||
src/paperless_ai/chat.py:0: error: Missing type arguments for generic type "list" [type-arg]
|
||||
src/paperless_ai/chat.py:0: error: Value of type variable "_SupportsAcloseT" of "aclosing" cannot be "AsyncIterator[str]" [type-var]
|
||||
src/paperless_ai/chat.py:0: error: Value of type variable "_SupportsAcloseT" of "aclosing" cannot be "AsyncIterator[str]" [type-var]
|
||||
src/paperless_ai/client.py:0: error: Incompatible types in assignment (expression has type "str | None", variable has type "str") [assignment]
|
||||
src/paperless_ai/client.py:0: error: Skipping analyzing "llama_index.llms.ollama": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless_ai/client.py:0: error: Skipping analyzing "llama_index.llms.openai_like": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
@@ -2175,6 +2267,7 @@ src/paperless_ai/indexing.py:0: error: Function is missing a type annotation [n
|
||||
src/paperless_ai/indexing.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless_ai/indexing.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless_ai/indexing.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless_ai/indexing.py:0: error: Incompatible types in assignment (expression has type "Document | None", variable has type "Document") [assignment]
|
||||
src/paperless_ai/matching.py:0: error: "type[ModelT]" has no attribute "objects" [attr-defined]
|
||||
src/paperless_ai/matching.py:0: error: "type[ModelT]" has no attribute "objects" [attr-defined]
|
||||
src/paperless_ai/matching.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
@@ -2204,6 +2297,8 @@ src/paperless_ai/tests/test_ai_classifier.py:0: error: Function is missing a typ
|
||||
src/paperless_ai/tests/test_ai_classifier.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_ai_classifier.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_ai_classifier.py:0: error: Need type annotation for "empty_candidates" [var-annotated]
|
||||
src/paperless_ai/tests/test_ai_indexing.py:0: error: "def get_embedding_model(config: AIConfig, *, refresh: bool = ...) -> BaseEmbedding" has no attribute "assert_called_once_with" [attr-defined]
|
||||
src/paperless_ai/tests/test_ai_indexing.py:0: error: "def get_embedding_model(config: AIConfig, *, refresh: bool = ...) -> BaseEmbedding" has no attribute "call_args" [attr-defined]
|
||||
src/paperless_ai/tests/test_base_model.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_base_model.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_base_model.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -2219,6 +2314,7 @@ src/paperless_ai/tests/test_base_model.py:0: error: Function is missing a return
|
||||
src/paperless_ai/tests/test_base_model.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_base_model.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_base_model.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_chat.py:0: error: "append" of "list" does not return a value (it only ever returns None) [func-returns-value]
|
||||
src/paperless_ai/tests/test_chat.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_chat.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_chat.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
@@ -2231,6 +2327,9 @@ src/paperless_ai/tests/test_chat.py:0: error: Function is missing a type annotat
|
||||
src/paperless_ai/tests/test_chat.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless_ai/tests/test_chat.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless_ai/tests/test_chat.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless_ai/tests/test_chat_cancellation.py:0: error: "AsyncIterator[str]" has no attribute "aclose" [attr-defined]
|
||||
src/paperless_ai/tests/test_chat_cancellation.py:0: error: Argument 4 to "_PreparedChat" has incompatible type "list[dict[str, object]]"; expected "list[dict[str, int | str]]" [arg-type]
|
||||
src/paperless_ai/tests/test_chat_chunk_merging.py:0: error: Return type "Iterator[CompletionResponse]" of "stream_complete" incompatible with return type "Generator[CompletionResponse, None, None]" in supertype "llama_index.core.base.llms.base.BaseLLM" [override]
|
||||
src/paperless_ai/tests/test_client.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_client.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_client.py:0: error: Function is missing a return type annotation [no-untyped-def]
|
||||
@@ -2264,6 +2363,8 @@ src/paperless_ai/tests/test_embedding.py:0: error: Function is missing a type an
|
||||
src/paperless_ai/tests/test_embedding.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_embedding.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_embedding.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_embedding.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_embedding.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_ai/tests/test_matching.py:0: error: Argument 1 to "match_tags_by_name" has incompatible type "list[str | None]"; expected "list[str]" [arg-type]
|
||||
src/paperless_ai/tests/test_matching.py:0: error: Missing type arguments for generic type "DjangoModelFactory" [type-arg]
|
||||
src/paperless_ai/tests/test_matching.py:0: error: Missing type arguments for generic type "list" [type-arg]
|
||||
@@ -2313,9 +2414,9 @@ src/paperless_ai/tests/test_vector_store.py:0: error: Function is missing a type
|
||||
src/paperless_ai/tests/test_vector_store.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless_ai/tests/test_vector_store.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless_ai/tests/test_vector_store.py:0: error: Skipping analyzing "sqlite_vec": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless_ai/vector_store.py:0: error: Argument 1 to "int" has incompatible type "int | float | str | list[str] | list[float] | list[int] | None"; expected "str | Buffer | SupportsInt | SupportsIndex" [arg-type]
|
||||
src/paperless_ai/vector_store.py:0: error: Argument 1 to "int" has incompatible type "int | float | str | list[str] | list[float] | list[int] | None"; expected "str | Buffer | SupportsInt | SupportsIndex" [arg-type]
|
||||
src/paperless_ai/vector_store.py:0: error: Argument 1 to "int" has incompatible type "str | Any | None"; expected "str | Buffer | SupportsInt | SupportsIndex" [arg-type]
|
||||
src/paperless_ai/vector_store.py:0: error: Argument 1 to "int" has incompatible type "int | float | str | list[str] | list[float] | list[int] | None"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc" [arg-type]
|
||||
src/paperless_ai/vector_store.py:0: error: Argument 1 to "int" has incompatible type "int | float | str | list[str] | list[float] | list[int] | None"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc" [arg-type]
|
||||
src/paperless_ai/vector_store.py:0: error: Argument 1 to "int" has incompatible type "str | Any | None"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc" [arg-type]
|
||||
src/paperless_ai/vector_store.py:0: error: Skipping analyzing "sqlite_vec": module is installed, but missing library stubs or py.typed marker [import-untyped]
|
||||
src/paperless_ai/vector_store.py:0: error: Unexpected keyword argument "flat_metadata" for "__init__" of "BasePydanticVectorStore" [call-arg]
|
||||
src/paperless_mail/admin.py:0: error: Missing type arguments for generic type "ModelAdmin" [type-arg]
|
||||
@@ -2380,8 +2481,6 @@ src/paperless_mail/migrations/0002_optimize_integer_field_sizes.py:0: error: Fun
|
||||
src/paperless_mail/migrations/0002_optimize_integer_field_sizes.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_mail/models.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_mail/models.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_mail/oauth.py:0: error: Argument "refresh_token" to "refresh_token" of "BaseOAuth2" has incompatible type "str | None"; expected "str" [arg-type]
|
||||
src/paperless_mail/oauth.py:0: error: Argument "refresh_token" to "refresh_token" of "BaseOAuth2" has incompatible type "str | None"; expected "str" [arg-type]
|
||||
src/paperless_mail/oauth.py:0: error: Argument 1 to "GoogleOAuth2" has incompatible type "str | None"; expected "str" [arg-type]
|
||||
src/paperless_mail/oauth.py:0: error: Argument 1 to "MicrosoftGraphOAuth2" has incompatible type "str | None"; expected "str" [arg-type]
|
||||
src/paperless_mail/oauth.py:0: error: Argument 2 to "GoogleOAuth2" has incompatible type "str | None"; expected "str" [arg-type]
|
||||
@@ -2399,8 +2498,6 @@ src/paperless_mail/serialisers.py:0: error: Function is missing a type annotatio
|
||||
src/paperless_mail/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_mail/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_mail/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_mail/serialisers.py:0: error: Function is missing a type annotation [no-untyped-def]
|
||||
src/paperless_mail/serialisers.py:0: error: Function is missing a type annotation for one or more parameters [no-untyped-def]
|
||||
src/paperless_mail/tasks.py:0: error: Missing type arguments for generic type "Task" [type-arg]
|
||||
src/paperless_mail/tests/helpers.py:0: error: "MailMessage" has no attribute "flagged" [attr-defined]
|
||||
src/paperless_mail/tests/helpers.py:0: error: "MailMessage" has no attribute "seen" [attr-defined]
|
||||
|
||||
@@ -38,7 +38,7 @@ repos:
|
||||
- json
|
||||
# See https://github.com/prettier/prettier/issues/15742 for the fork reason
|
||||
- repo: https://github.com/rbubley/mirrors-prettier
|
||||
rev: 'v3.10.1'
|
||||
rev: 'v3.9.10'
|
||||
hooks:
|
||||
- id: prettier
|
||||
types_or:
|
||||
@@ -46,7 +46,7 @@ repos:
|
||||
- ts
|
||||
- markdown
|
||||
additional_dependencies:
|
||||
- prettier@3.10.1
|
||||
- prettier@3.9.10
|
||||
- 'prettier-plugin-organize-imports@4.3.0'
|
||||
# Python hooks
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
@@ -55,7 +55,7 @@ repos:
|
||||
- id: ruff-check
|
||||
- id: ruff-format
|
||||
- repo: https://github.com/tox-dev/pyproject-fmt
|
||||
rev: "v2.31.2"
|
||||
rev: "v2.30.3"
|
||||
hooks:
|
||||
- id: pyproject-fmt
|
||||
additional_dependencies: [tomli]
|
||||
|
||||
+1009
-400
File diff suppressed because it is too large.
Load diff
@@ -35,7 +35,7 @@ services:
|
||||
- "3143:3143" # IMAP
|
||||
restart: unless-stopped
|
||||
nginx:
|
||||
image: docker.io/nginx:1.31.9-alpine
|
||||
image: docker.io/nginx:1.31.7-alpine
|
||||
hostname: nginx
|
||||
container_name: nginx
|
||||
ports:
|
||||
|
||||
+8
-13
@@ -19,15 +19,14 @@ classifiers = [
|
||||
dependencies = [
|
||||
"azure-ai-documentintelligence>=1.0.2",
|
||||
"babel>=2.17",
|
||||
"celery[redis]~=5.7.0",
|
||||
"celery[redis]~=5.6.2",
|
||||
"channels~=4.2",
|
||||
"channels-redis~=4.2",
|
||||
"concurrent-log-handler~=0.9.25",
|
||||
"cryptography>=50",
|
||||
"dateparser~=1.4",
|
||||
# WARNING: django does not use semver.
|
||||
# Only patch versions are guaranteed to not introduce breaking changes.
|
||||
"django~=5.2.19",
|
||||
"django~=5.2.18",
|
||||
"django-allauth[mfa,socialaccount]~=65.21.1",
|
||||
"django-auditlog~=3.4.1",
|
||||
"django-cachalot~=2.9.0",
|
||||
@@ -47,9 +46,8 @@ dependencies = [
|
||||
"flower>=2.0.1,<2.3",
|
||||
"gotenberg-client[httpx]~=1.0",
|
||||
"httpx-oauth~=0.17",
|
||||
"humanize>=4.15",
|
||||
"ijson>=3.5.1",
|
||||
"imap-tools>=1.14,<1.17",
|
||||
"imap-tools>=1.14,<1.16",
|
||||
"jinja2~=3.1.6",
|
||||
"langdetect~=1.0.9",
|
||||
"llama-index-core>=0.14.23",
|
||||
@@ -58,13 +56,10 @@ dependencies = [
|
||||
"llama-index-embeddings-openai-like>=0.2.2",
|
||||
"llama-index-llms-ollama>=0.9.1",
|
||||
"llama-index-llms-openai-like>=0.7.1",
|
||||
"lxml>=6.1",
|
||||
"ocrmypdf[heic]>=17.12,<17.13",
|
||||
"ollama>=0.6.1",
|
||||
"openai>=2.48",
|
||||
"pathvalidate~=3.3.1",
|
||||
"pdf2image~=1.17.0",
|
||||
"pikepdf>=10.13",
|
||||
"python-dateutil~=2.9.0",
|
||||
"python-dotenv~=1.2.1",
|
||||
"python-gnupg~=0.5.4",
|
||||
@@ -79,8 +74,8 @@ dependencies = [
|
||||
"sqlite-vec==0.1.10+paperless.3",
|
||||
"tantivy~=0.26.0",
|
||||
"tika-client[httpx]~=1.0",
|
||||
"torch>=2.13,<2.16",
|
||||
"turbohtml~=1.16.0",
|
||||
"torch>=2.13,<2.15",
|
||||
"turbohtml~=1.15.3",
|
||||
"watchfiles>=1.2",
|
||||
"whitenoise~=6.11",
|
||||
"whoosh-compat[tantivy]==0.3",
|
||||
@@ -116,15 +111,15 @@ lint = [
|
||||
testing = [
|
||||
"daphne",
|
||||
"factory-boy~=3.3.1",
|
||||
"faker>=40.36,<40.64",
|
||||
"faker>=40.36,<40.44",
|
||||
"imagehash",
|
||||
"pytest~=9.2.0",
|
||||
"pytest~=9.1.1",
|
||||
"pytest-cov~=7.1.0",
|
||||
"pytest-django>=4.12,<4.15",
|
||||
"pytest-env~=1.8.1",
|
||||
"pytest-httpx",
|
||||
"pytest-mock~=3.17.0",
|
||||
"pytest-randomly~=5.1.0",
|
||||
"pytest-randomly~=5.0.0",
|
||||
"pytest-rerunfailures~=16.4",
|
||||
"pytest-sugar",
|
||||
"pytest-xdist~=3.8.0",
|
||||
|
||||
+35
-35
@@ -5,14 +5,14 @@
|
||||
<trans-unit id="ngb.alert.close" datatype="html">
|
||||
<source>Close</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/alert/alert.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/alert/alert.ts</context>
|
||||
<context context-type="linenumber">38,39</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.carousel.slide-number" datatype="html">
|
||||
<source> Slide <x id="INTERPOLATION" equiv-text="source?: NgbSli"/> of <x id="INTERPOLATION_1" equiv-text="s._cycleToSelec"/> </source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/carousel/carousel.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/carousel/carousel.ts</context>
|
||||
<context context-type="linenumber">386,393</context>
|
||||
</context-group>
|
||||
<note priority="1" from="description">Currently selected slide number read by screen reader</note>
|
||||
@@ -20,219 +20,219 @@
|
||||
<trans-unit id="ngb.carousel.previous" datatype="html">
|
||||
<source>Previous</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/carousel/carousel.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/carousel/carousel.ts</context>
|
||||
<context context-type="linenumber">425,426</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.carousel.next" datatype="html">
|
||||
<source>Next</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/carousel/carousel.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/carousel/carousel.ts</context>
|
||||
<context context-type="linenumber">452,453</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.datepicker.select-month" datatype="html">
|
||||
<source>Select month</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/datepicker/datepicker-navigation-select.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/datepicker/datepicker-navigation-select.ts</context>
|
||||
<context context-type="linenumber">52</context>
|
||||
</context-group>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/datepicker/datepicker-navigation-select.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/datepicker/datepicker-navigation-select.ts</context>
|
||||
<context context-type="linenumber">52</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.datepicker.select-year" datatype="html">
|
||||
<source>Select year</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/datepicker/datepicker-navigation-select.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/datepicker/datepicker-navigation-select.ts</context>
|
||||
<context context-type="linenumber">52</context>
|
||||
</context-group>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/datepicker/datepicker-navigation-select.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/datepicker/datepicker-navigation-select.ts</context>
|
||||
<context context-type="linenumber">52</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.datepicker.previous-month" datatype="html">
|
||||
<source>Previous month</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/datepicker/datepicker-navigation.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/datepicker/datepicker-navigation.ts</context>
|
||||
<context context-type="linenumber">73,76</context>
|
||||
</context-group>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/datepicker/datepicker-navigation.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/datepicker/datepicker-navigation.ts</context>
|
||||
<context context-type="linenumber">73,76</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.datepicker.next-month" datatype="html">
|
||||
<source>Next month</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/datepicker/datepicker-navigation.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/datepicker/datepicker-navigation.ts</context>
|
||||
<context context-type="linenumber">73,74</context>
|
||||
</context-group>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/datepicker/datepicker-navigation.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/datepicker/datepicker-navigation.ts</context>
|
||||
<context context-type="linenumber">73,74</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.pagination.first" datatype="html">
|
||||
<source>««</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="linenumber">277,278</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.pagination.previous" datatype="html">
|
||||
<source>«</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="linenumber">277,278</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.pagination.next" datatype="html">
|
||||
<source>»</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="linenumber">277</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.pagination.last" datatype="html">
|
||||
<source>»»</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="linenumber">277</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.pagination.first-aria" datatype="html">
|
||||
<source>First</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="linenumber">277,278</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.pagination.previous-aria" datatype="html">
|
||||
<source>Previous</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="linenumber">277,278</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.pagination.next-aria" datatype="html">
|
||||
<source>Next</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="linenumber">277,278</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.pagination.last-aria" datatype="html">
|
||||
<source>Last</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/pagination/pagination.ts</context>
|
||||
<context context-type="linenumber">277,278</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.progressbar.value" datatype="html">
|
||||
<source><x id="INTERPOLATION"/></source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/progressbar/progressbar.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/progressbar/progressbar.ts</context>
|
||||
<context context-type="linenumber">39,40</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.HH" datatype="html">
|
||||
<source>HH</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.hours" datatype="html">
|
||||
<source>Hours</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.MM" datatype="html">
|
||||
<source>MM</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.minutes" datatype="html">
|
||||
<source>Minutes</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.increment-hours" datatype="html">
|
||||
<source>Increment hours</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.decrement-hours" datatype="html">
|
||||
<source>Decrement hours</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.increment-minutes" datatype="html">
|
||||
<source>Increment minutes</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.decrement-minutes" datatype="html">
|
||||
<source>Decrement minutes</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.SS" datatype="html">
|
||||
<source>SS</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.seconds" datatype="html">
|
||||
<source>Seconds</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.increment-seconds" datatype="html">
|
||||
<source>Increment seconds</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.decrement-seconds" datatype="html">
|
||||
<source>Decrement seconds</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.timepicker.PM" datatype="html">
|
||||
<source><x id="INTERPOLATION"/></source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/timepicker/timepicker.ts</context>
|
||||
<context context-type="linenumber">442</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ngb.toast.close-aria" datatype="html">
|
||||
<source>Close</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.3.0_@angular+core@22.3.0_@angular+_a7f2e22ebef7f277c3d304e2c62cd610/node_modules/src/toast/toast.ts</context>
|
||||
<context context-type="sourcefile">node_modules/.pnpm/@ng-bootstrap+ng-bootstrap@21.0.0_@angular+common@22.2.3_@angular+core@22.2.3_@angular+_2a970977f09c8afdd1f9933e219c8db5/node_modules/src/toast/toast.ts</context>
|
||||
<context context-type="linenumber">80</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
|
||||
+30
-30
@@ -15,60 +15,60 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/cdk": "^22.3.0",
|
||||
"@angular/common": "~22.3.0",
|
||||
"@angular/compiler": "~22.3.0",
|
||||
"@angular/core": "~22.3.0",
|
||||
"@angular/forms": "~22.3.0",
|
||||
"@angular/localize": "~22.3.0",
|
||||
"@angular/platform-browser": "~22.3.0",
|
||||
"@angular/router": "~22.3.0",
|
||||
"@angular/cdk": "^22.2.4",
|
||||
"@angular/common": "~22.2.3",
|
||||
"@angular/compiler": "~22.2.3",
|
||||
"@angular/core": "~22.2.3",
|
||||
"@angular/forms": "~22.2.3",
|
||||
"@angular/localize": "~22.2.3",
|
||||
"@angular/platform-browser": "~22.2.3",
|
||||
"@angular/router": "~22.2.3",
|
||||
"@ng-bootstrap/ng-bootstrap": "^21.0.0",
|
||||
"@ng-select/ng-select": "~24.2.1",
|
||||
"@ngneat/dirty-check-forms": "^3.0.3",
|
||||
"@popperjs/core": "^2.11.8",
|
||||
"bootstrap": "^5.3.9",
|
||||
"bootstrap": "^5.3.8",
|
||||
"bootstrap-icons": "^1.13.2",
|
||||
"file-saver": "^2.0.5",
|
||||
"lodash-es": "^4.18.1",
|
||||
"marked": "~18.2.1",
|
||||
"marked": "~18.1.1",
|
||||
"mime-names": "^1.0.0",
|
||||
"ngx-color": "^10.1.0",
|
||||
"ngx-cookie-service": "^22.2.0",
|
||||
"ngx-cookie-service": "^22.0.0",
|
||||
"ngx-device-detector": "^12.0.0",
|
||||
"ngx-ui-tour-ng-bootstrap": "^19.0.0",
|
||||
"normalize-diacritics": "^5.0.0",
|
||||
"pdfjs-dist": "^6.5.438",
|
||||
"pdfjs-dist": "^6.4.299",
|
||||
"rxjs": "^7.8.2",
|
||||
"tslib": "^2.9.1",
|
||||
"tslib": "^2.8.1",
|
||||
"utif": "^3.1.0",
|
||||
"uuid": "^14.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-builders/jest": "^22.0.1",
|
||||
"@angular-devkit/core": "^22.3.0",
|
||||
"@angular-devkit/schematics": "^22.3.0",
|
||||
"@angular-eslint/builder": "22.8.0",
|
||||
"@angular-eslint/eslint-plugin": "22.8.0",
|
||||
"@angular-eslint/eslint-plugin-template": "22.8.0",
|
||||
"@angular-eslint/schematics": "22.8.0",
|
||||
"@angular-eslint/template-parser": "22.8.0",
|
||||
"@angular/build": "22.3.0",
|
||||
"@angular/cli": "22.3.0",
|
||||
"@angular/compiler-cli": "~22.3.0",
|
||||
"@playwright/test": "^1.65.1",
|
||||
"@angular-devkit/core": "^22.2.4",
|
||||
"@angular-devkit/schematics": "^22.2.4",
|
||||
"@angular-eslint/builder": "22.6.0",
|
||||
"@angular-eslint/eslint-plugin": "22.6.0",
|
||||
"@angular-eslint/eslint-plugin-template": "22.6.0",
|
||||
"@angular-eslint/schematics": "22.6.0",
|
||||
"@angular-eslint/template-parser": "22.6.0",
|
||||
"@angular/build": "22.2.4",
|
||||
"@angular/cli": "22.2.4",
|
||||
"@angular/compiler-cli": "~22.2.3",
|
||||
"@playwright/test": "^1.64.1",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^26.6.6",
|
||||
"@typescript-eslint/eslint-plugin": "^8.74.0",
|
||||
"@typescript-eslint/parser": "^8.74.0",
|
||||
"@typescript-eslint/utils": "^8.74.0",
|
||||
"eslint": "^10.15.0",
|
||||
"@types/node": "^26.6.5",
|
||||
"@typescript-eslint/eslint-plugin": "^8.72.0",
|
||||
"@typescript-eslint/parser": "^8.72.0",
|
||||
"@typescript-eslint/utils": "^8.72.0",
|
||||
"eslint": "^10.13.0",
|
||||
"jest": "30.5.2",
|
||||
"jest-environment-jsdom": "^30.5.2",
|
||||
"jest-junit": "^17.0.0",
|
||||
"jest-preset-angular": "^17.0.3",
|
||||
"jest-websocket-mock": "^2.5.0",
|
||||
"prettier": "^3.10.1",
|
||||
"prettier": "^3.9.10",
|
||||
"prettier-plugin-organize-imports": "^4.3.0",
|
||||
"ts-node": "~10.9.2",
|
||||
"typescript": "^6.0.3"
|
||||
|
||||
Generated
+1235
-1670
File diff suppressed because it is too large.
Load diff
@@ -73,10 +73,9 @@ def get_suggestion_cache(document_id: int) -> SuggestionCacheData | None:
|
||||
|
||||
doc_key = get_suggestion_cache_key(document_id)
|
||||
cache_hits = cache.get_many([CLASSIFIER_VERSION_KEY, CLASSIFIER_HASH_KEY, doc_key])
|
||||
# The document suggestions are in the cache. get_many keeps an entry the cache
|
||||
# serializer rejected as None, rather than leaving the key out.
|
||||
doc_suggestions: SuggestionCacheData | None = cache_hits.get(doc_key)
|
||||
if doc_suggestions is not None:
|
||||
# The document suggestions are in the cache
|
||||
if doc_key in cache_hits:
|
||||
doc_suggestions: SuggestionCacheData = cache_hits[doc_key]
|
||||
# The classifier format is the same
|
||||
# The classifier hash is the same
|
||||
# Then the suggestions can be used
|
||||
|
||||
+73
-11
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
import hmac
|
||||
import logging
|
||||
import pickle
|
||||
import re
|
||||
@@ -14,6 +15,9 @@ if TYPE_CHECKING:
|
||||
from collections.abc import Callable
|
||||
from collections.abc import Iterator
|
||||
from datetime import datetime
|
||||
from types import TracebackType
|
||||
from typing import BinaryIO
|
||||
from typing import Self
|
||||
|
||||
import tantivy
|
||||
from numpy import ndarray
|
||||
@@ -33,11 +37,9 @@ from documents.caching import CLASSIFIER_VERSION_KEY
|
||||
from documents.models import Document
|
||||
from documents.models import MatchingModel
|
||||
from documents.models import Tag
|
||||
from paperless.signed_pickle import SignedFileWriter
|
||||
from paperless.signed_pickle import SignedPickleError
|
||||
from paperless.signed_pickle import signed_pickle_dumps
|
||||
from paperless.signed_pickle import signed_pickle_loads
|
||||
from paperless.signed_pickle import verify_signed
|
||||
|
||||
logger = logging.getLogger("paperless.classifier")
|
||||
|
||||
@@ -75,6 +77,49 @@ RE_WORD = re.compile(r"\b[\w]+\b") # words that may contain digits
|
||||
_CONTENT_CHUNK_SIZE = 1000
|
||||
|
||||
|
||||
class _SignedFileWriter:
|
||||
"""
|
||||
Atomically writes a file made of an HMAC signature followed by the data,
|
||||
signing the data as it streams to disk rather than holding it in memory.
|
||||
|
||||
The signature is only known once everything is written, so its space is
|
||||
reserved at the start of the file and filled in on exit. The target is only
|
||||
replaced once the file is complete; on error the partial file is removed.
|
||||
"""
|
||||
|
||||
def __init__(self, target: Path, mac: hmac.HMAC) -> None:
|
||||
self._target = target
|
||||
self._temp = target.with_name(f"{target.name}.part")
|
||||
self._mac = mac
|
||||
self._file: BinaryIO
|
||||
|
||||
def __enter__(self) -> Self:
|
||||
self._file = self._temp.open("wb")
|
||||
self._file.write(bytes(self._mac.digest_size))
|
||||
return self
|
||||
|
||||
def write(self, data: bytes | memoryview) -> int:
|
||||
self._mac.update(data)
|
||||
return self._file.write(data)
|
||||
|
||||
def __exit__(
|
||||
self,
|
||||
exc_type: type[BaseException] | None,
|
||||
exc_value: BaseException | None,
|
||||
traceback: TracebackType | None,
|
||||
) -> None:
|
||||
try:
|
||||
with self._file:
|
||||
if exc_type is None:
|
||||
self._file.seek(0)
|
||||
self._file.write(self._mac.digest())
|
||||
if exc_type is None:
|
||||
self._temp.rename(self._target)
|
||||
finally:
|
||||
# A no-op after a successful rename, otherwise removes the partial file
|
||||
self._temp.unlink(missing_ok=True)
|
||||
|
||||
|
||||
@functools.cache
|
||||
def _text_analyzer(language: str) -> tantivy.TextAnalyzer:
|
||||
"""
|
||||
@@ -164,6 +209,8 @@ class DocumentClassifier:
|
||||
# Tantivy text preprocessing
|
||||
FORMAT_VERSION = 11
|
||||
|
||||
HMAC_SIZE = 32 # SHA-256 digest length
|
||||
|
||||
def __init__(self) -> None:
|
||||
# last time a document changed and therefore training might be required
|
||||
self.last_doc_change_time: datetime | None = None
|
||||
@@ -183,6 +230,10 @@ class DocumentClassifier:
|
||||
pickle.dumps(self.data_vectorizer),
|
||||
).hexdigest()
|
||||
|
||||
@staticmethod
|
||||
def _new_hmac() -> hmac.HMAC:
|
||||
return hmac.new(settings.SECRET_KEY.encode(), digestmod=sha256)
|
||||
|
||||
@staticmethod
|
||||
def _strip_training_state(classifier: MLPClassifier) -> None:
|
||||
"""
|
||||
@@ -197,19 +248,30 @@ class DocumentClassifier:
|
||||
del classifier._best_coefs
|
||||
del classifier._best_intercepts
|
||||
|
||||
@staticmethod
|
||||
def _compute_hmac(data: bytes | memoryview) -> bytes:
|
||||
mac = DocumentClassifier._new_hmac()
|
||||
mac.update(data)
|
||||
return mac.digest()
|
||||
|
||||
def load(self) -> None:
|
||||
from sklearn.exceptions import InconsistentVersionWarning
|
||||
|
||||
raw = Path(settings.MODEL_FILE).read_bytes()
|
||||
|
||||
# The whole file is verified from memory before unpickling, rather than
|
||||
# streamed from disk, so it cannot change between check and load.
|
||||
# verify_signed returns a view of the data without copying the
|
||||
# (potentially multi-GB) payload.
|
||||
try:
|
||||
data = verify_signed(raw)
|
||||
except SignedPickleError as err:
|
||||
raise ClassifierModelCorruptError from err
|
||||
if len(raw) <= self.HMAC_SIZE:
|
||||
raise ClassifierModelCorruptError
|
||||
|
||||
# Slice through a memoryview so the (potentially multi-GB) payload is
|
||||
# not copied; hmac and pickle both accept buffers directly.
|
||||
# The whole file is still verified from memory before unpickling, rather
|
||||
# than streamed from disk, so it cannot change between check and load.
|
||||
view = memoryview(raw)
|
||||
signature = view[: self.HMAC_SIZE]
|
||||
data = view[self.HMAC_SIZE :]
|
||||
|
||||
if not hmac.compare_digest(signature, self._compute_hmac(data)):
|
||||
raise ClassifierModelCorruptError
|
||||
|
||||
# Catch warnings for processing
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
@@ -253,7 +315,7 @@ class DocumentClassifier:
|
||||
def save(self) -> None:
|
||||
# Stream to disk instead of building the payload in memory. Protocol 5+
|
||||
# pickles numpy arrays without copying them (the default is 4 before 3.14).
|
||||
with SignedFileWriter(settings.MODEL_FILE) as f:
|
||||
with _SignedFileWriter(settings.MODEL_FILE, self._new_hmac()) as f:
|
||||
pickle.dump(
|
||||
(
|
||||
self.FORMAT_VERSION,
|
||||
|
||||
@@ -74,10 +74,6 @@ _LOCK_BACKOFF_CAP: Final[float] = 10.0 # seconds
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
# Upper bound on autocomplete suggestions. tantivy sizes its collector from the
|
||||
# requested limit, so an unbounded value aborts the whole process on allocation.
|
||||
MAX_AUTOCOMPLETE_LIMIT = 1000
|
||||
|
||||
|
||||
class ViewerGrant(NamedTuple):
|
||||
"""Direct user and group view grants for a single document.
|
||||
@@ -1002,8 +998,7 @@ class TantivyBackend:
|
||||
|
||||
Args:
|
||||
term: Prefix to match against autocomplete words
|
||||
limit: Maximum number of suggestions to return, capped at
|
||||
MAX_AUTOCOMPLETE_LIMIT
|
||||
limit: Maximum number of suggestions to return
|
||||
user: User for permission filtering (None for no filtering)
|
||||
|
||||
Returns:
|
||||
@@ -1026,7 +1021,7 @@ class TantivyBackend:
|
||||
"autocomplete_word",
|
||||
normalized_term,
|
||||
permission_query,
|
||||
min(limit, MAX_AUTOCOMPLETE_LIMIT),
|
||||
limit,
|
||||
)
|
||||
|
||||
return [x[0] for x in matches]
|
||||
|
||||
@@ -112,10 +112,6 @@ if TYPE_CHECKING:
|
||||
|
||||
logger = logging.getLogger("paperless.serializers")
|
||||
|
||||
# How much of an upload is read to detect its type. libmagic examines at most
|
||||
# 7 MiB (its default bytes_max), so this is more than it will ever look at.
|
||||
_MIME_SNIFF_BYTES = 8 * 1024 * 1024
|
||||
|
||||
|
||||
# https://www.django-rest-framework.org/api-guide/serializers/#example
|
||||
class DynamicFieldsModelSerializer(serializers.ModelSerializer[Any]):
|
||||
@@ -2367,9 +2363,8 @@ class PostDocumentSerializer(serializers.Serializer[dict[str, Any]]):
|
||||
)
|
||||
|
||||
def validate_document(self, document):
|
||||
# libmagic only examines a bounded prefix, so an upload of any size is
|
||||
# never read into memory just to detect its type
|
||||
mime_type = magic.from_buffer(document.read(_MIME_SNIFF_BYTES), mime=True)
|
||||
document_data = document.file.read()
|
||||
mime_type = magic.from_buffer(document_data, mime=True)
|
||||
|
||||
if not is_mime_type_supported(mime_type):
|
||||
if (
|
||||
@@ -2385,7 +2380,7 @@ class PostDocumentSerializer(serializers.Serializer[dict[str, Any]]):
|
||||
_("File type %(type)s not supported") % {"type": mime_type},
|
||||
)
|
||||
|
||||
return document.name, document
|
||||
return document.name, document_data
|
||||
|
||||
def validate_correspondent(self, correspondent):
|
||||
if correspondent:
|
||||
|
||||
@@ -786,15 +786,15 @@ def cleanup_user_deletion(sender, instance: User | Group, **kwargs) -> None:
|
||||
if instance.pk in permissions.get("default_view_users", []):
|
||||
permissions["default_view_users"].remove(instance.pk)
|
||||
updated = True
|
||||
if instance.pk in permissions.get("default_edit_users", []):
|
||||
permissions["default_edit_users"].remove(instance.pk)
|
||||
if instance.pk in permissions.get("default_change_users", []):
|
||||
permissions["default_change_users"].remove(instance.pk)
|
||||
updated = True
|
||||
elif isinstance(instance, Group):
|
||||
if instance.pk in permissions.get("default_view_groups", []):
|
||||
permissions["default_view_groups"].remove(instance.pk)
|
||||
updated = True
|
||||
if instance.pk in permissions.get("default_edit_groups", []):
|
||||
permissions["default_edit_groups"].remove(instance.pk)
|
||||
if instance.pk in permissions.get("default_change_groups", []):
|
||||
permissions["default_change_groups"].remove(instance.pk)
|
||||
updated = True
|
||||
if updated:
|
||||
ui_settings.settings["permissions"] = permissions
|
||||
|
||||
+21
-10
@@ -6,6 +6,7 @@ import zipfile
|
||||
from collections.abc import Callable
|
||||
from pathlib import Path
|
||||
from tempfile import TemporaryDirectory
|
||||
from tempfile import mkstemp
|
||||
|
||||
from celery import Task
|
||||
from celery import shared_task
|
||||
@@ -896,25 +897,26 @@ def build_share_link_bundle(bundle_id: int) -> None:
|
||||
|
||||
documents = list(bundle.documents.all().order_by("pk"))
|
||||
|
||||
_, temp_zip_path_str = mkstemp(suffix=".zip", dir=settings.SCRATCH_DIR)
|
||||
temp_zip_path = Path(temp_zip_path_str)
|
||||
|
||||
try:
|
||||
strategy_class = (
|
||||
ArchiveOnlyStrategy
|
||||
if bundle.file_version == ShareLink.FileVersion.ARCHIVE
|
||||
else OriginalsOnlyStrategy
|
||||
)
|
||||
with zipfile.ZipFile(temp_zip_path, "w", zipfile.ZIP_DEFLATED) as zipf:
|
||||
strategy = strategy_class(zipf)
|
||||
for document in documents:
|
||||
strategy.add_document(document)
|
||||
|
||||
output_dir = settings.SHARE_LINK_BUNDLE_DIR
|
||||
output_dir.mkdir(parents=True, exist_ok=True)
|
||||
final_path = (output_dir / f"{bundle.slug}.zip").resolve()
|
||||
|
||||
with TemporaryDirectory(dir=settings.SCRATCH_DIR) as tmp_dir:
|
||||
temp_zip_path = Path(tmp_dir) / "bundle.zip"
|
||||
with zipfile.ZipFile(temp_zip_path, "w", zipfile.ZIP_DEFLATED) as zipf:
|
||||
strategy = strategy_class(zipf)
|
||||
for document in documents:
|
||||
strategy.add_document(document)
|
||||
|
||||
final_path.unlink(missing_ok=True)
|
||||
shutil.move(temp_zip_path, final_path)
|
||||
if final_path.exists():
|
||||
final_path.unlink()
|
||||
shutil.move(temp_zip_path, final_path)
|
||||
|
||||
bundle.file_path = f"{bundle.slug}.zip"
|
||||
bundle.size_bytes = final_path.stat().st_size
|
||||
@@ -945,7 +947,16 @@ def build_share_link_bundle(bundle_id: int) -> None:
|
||||
"timestamp": timezone.now().isoformat(),
|
||||
}
|
||||
bundle.save(update_fields=["status", "last_error"])
|
||||
try:
|
||||
temp_zip_path.unlink()
|
||||
except OSError:
|
||||
pass
|
||||
raise
|
||||
finally:
|
||||
try:
|
||||
temp_zip_path.unlink(missing_ok=True)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
@shared_task
|
||||
|
||||
@@ -1069,13 +1069,6 @@ class TestAutocomplete:
|
||||
results = backend.autocomplete("micro", limit=10)
|
||||
assert "microsoft" in results
|
||||
|
||||
def test_huge_limit_is_clamped(self, backend: TantivyBackend) -> None:
|
||||
"""An oversized limit must be capped, not handed to tantivy as-is."""
|
||||
doc = DocumentFactory.create(title="Microsoft invoice", content="payment")
|
||||
backend.add_or_update(doc)
|
||||
|
||||
assert "microsoft" in backend.autocomplete("micro", limit=10**15)
|
||||
|
||||
def test_results_ordered_by_document_frequency(
|
||||
self,
|
||||
backend: TantivyBackend,
|
||||
|
||||
@@ -2089,38 +2089,6 @@ class TestDocumentApi(DirectoriesMixin, ConsumeTaskMixin, APITestCase):
|
||||
self.assertIsNone(overrides.document_type_id)
|
||||
self.assertIsNone(overrides.tag_ids)
|
||||
|
||||
def test_upload_type_is_detected_from_a_prefix(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An upload larger than the prefix read to detect its type
|
||||
WHEN:
|
||||
- The document is posted
|
||||
THEN:
|
||||
- The type is detected from the prefix and the upload is accepted
|
||||
- The file handed to the consumer holds the whole upload
|
||||
"""
|
||||
self.consume_file_mock.return_value = celery.result.AsyncResult(
|
||||
id=str(uuid.uuid4()),
|
||||
)
|
||||
content = SIMPLE_DIGITAL_PDF.read_bytes()
|
||||
|
||||
with (
|
||||
mock.patch("documents.serialisers._MIME_SNIFF_BYTES", 1024),
|
||||
SimpleUploadedFile(
|
||||
"simple.pdf",
|
||||
content,
|
||||
content_type="application/pdf",
|
||||
) as f,
|
||||
):
|
||||
response = self.client.post(
|
||||
"/api/documents/post_document/",
|
||||
{"document": f},
|
||||
)
|
||||
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
input_doc, _ = self.assert_queue_consumption_task_call_args()
|
||||
self.assertEqual(input_doc.original_file.read_bytes(), content)
|
||||
|
||||
def test_upload_with_path_traversal_filename_is_reduced_to_basename(self) -> None:
|
||||
self.consume_file_mock.return_value = celery.result.AsyncResult(
|
||||
id=str(uuid.uuid4()),
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
from django.core.management import call_command
|
||||
from django.core.management.base import CommandError
|
||||
@@ -339,41 +337,3 @@ class TestDocumentListObjectFilterSchema:
|
||||
param = next(p for p in params if p["name"] == param_name)
|
||||
assert param["schema"] == {"type": "array", "items": {"type": "integer"}}
|
||||
assert param["explode"] is False
|
||||
|
||||
|
||||
class TestOauthCallbackSchema:
|
||||
@pytest.mark.parametrize("name", ["code", "state"])
|
||||
def test_empty_code_and_state_are_not_schema_valid(
|
||||
self,
|
||||
api_schema: dict[str, Any],
|
||||
name: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- The generated schema
|
||||
WHEN:
|
||||
- The code and state parameters of the OAuth callback are read
|
||||
THEN:
|
||||
- They are required and not empty, the view answers 400 to an empty one
|
||||
"""
|
||||
params = api_schema["paths"]["/api/oauth/callback/"]["get"]["parameters"]
|
||||
param = next(p for p in params if p["name"] == name)
|
||||
|
||||
assert param["required"] is True
|
||||
assert param["schema"]["minLength"] == 1
|
||||
|
||||
|
||||
class TestOcrPageImageSchema:
|
||||
def test_page_image_is_declared_as_png(self, api_schema: dict[str, Any]) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- The generated schema
|
||||
WHEN:
|
||||
- The 200 response of the OCR template page image is read
|
||||
THEN:
|
||||
- It is a PNG, which is what the view serves
|
||||
"""
|
||||
path = "/api/ocr_templates/document-page-image/{doc_id}/{page}/"
|
||||
content = api_schema["paths"][path]["get"]["responses"]["200"]["content"]
|
||||
|
||||
assert list(content) == ["image/png"]
|
||||
@@ -671,8 +671,8 @@ class TestDocumentSearchApi(DirectoriesMixin, APITestCase):
|
||||
content="things i paid for in august",
|
||||
pk=2,
|
||||
checksum="B",
|
||||
# More than 1 month ago, in the search timezone
|
||||
added=timezone.localtime() - relativedelta(months=1, days=7),
|
||||
# 1 month, 1 day ago
|
||||
added=timezone.now() - relativedelta(months=1, days=1),
|
||||
)
|
||||
d3 = Document.objects.create(
|
||||
title="bank statement 3",
|
||||
@@ -706,10 +706,6 @@ class TestDocumentSearchApi(DirectoriesMixin, APITestCase):
|
||||
@override_settings(
|
||||
TIME_ZONE="America/Denver",
|
||||
)
|
||||
@time_machine.travel(
|
||||
datetime.datetime(2026, 12, 1, 0, 1, tzinfo=datetime.UTC),
|
||||
tick=False,
|
||||
)
|
||||
def test_search_added_in_last_month_timezone_behind(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
@@ -733,8 +729,8 @@ class TestDocumentSearchApi(DirectoriesMixin, APITestCase):
|
||||
content="things i paid for in august",
|
||||
pk=2,
|
||||
checksum="B",
|
||||
# More than 1 month ago, in the search timezone
|
||||
added=timezone.localtime() - relativedelta(months=1, days=7),
|
||||
# 1 month, 1 day ago
|
||||
added=timezone.now() - relativedelta(months=1, days=1),
|
||||
)
|
||||
d3 = Document.objects.create(
|
||||
title="bank statement 3",
|
||||
@@ -1000,9 +996,6 @@ class TestDocumentSearchApi(DirectoriesMixin, APITestCase):
|
||||
response = self.client.get("/api/search/autocomplete/?term=test&limit=-1")
|
||||
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
response = self.client.get("/api/search/autocomplete/?term=test&limit=null")
|
||||
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
response = self.client.get("/api/search/autocomplete/")
|
||||
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
from pytest_mock import MockerFixture
|
||||
|
||||
from documents.caching import CLASSIFIER_VERSION_KEY
|
||||
from documents.caching import get_suggestion_cache
|
||||
from documents.caching import get_suggestion_cache_key
|
||||
from documents.classifier import DocumentClassifier
|
||||
|
||||
|
||||
class TestGetSuggestionCache:
|
||||
def test_rejected_entry_is_a_cache_miss(self, mocker: MockerFixture) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A document suggestion entry the cache serializer rejected, which
|
||||
get_many reports as None
|
||||
- A classifier version entry matching the current format
|
||||
WHEN:
|
||||
- The suggestion cache is read
|
||||
THEN:
|
||||
- It is treated as a cache miss
|
||||
"""
|
||||
doc_key = get_suggestion_cache_key(1)
|
||||
mocker.patch(
|
||||
"documents.caching.cache.get_many",
|
||||
return_value={
|
||||
CLASSIFIER_VERSION_KEY: DocumentClassifier.FORMAT_VERSION,
|
||||
doc_key: None,
|
||||
},
|
||||
)
|
||||
|
||||
assert get_suggestion_cache(1) is None
|
||||
@@ -1,5 +1,3 @@
|
||||
import hashlib
|
||||
import hmac
|
||||
import pickle
|
||||
import warnings
|
||||
from datetime import UTC
|
||||
@@ -33,7 +31,6 @@ from documents.models import Tag
|
||||
from documents.tests.helpers import dummy_preprocess
|
||||
from paperless.settings import CLASSIFIER_LANGUAGES
|
||||
from paperless.signed_pickle import HMAC_SIZE
|
||||
from paperless.signed_pickle import compute_signature
|
||||
from paperless.signed_pickle import signed_pickle_dumps
|
||||
from paperless_testing.dirs import DirectoriesMixin
|
||||
from paperless_testing.factories import DocumentFactory
|
||||
@@ -426,7 +423,7 @@ class TestClassifier(DirectoriesMixin, TestCase):
|
||||
- The ClassifierModelCorruptError is raised
|
||||
"""
|
||||
garbage_data = b"this is not valid pickle data"
|
||||
signature = compute_signature(garbage_data)
|
||||
signature = DocumentClassifier._compute_hmac(garbage_data)
|
||||
Path(settings.MODEL_FILE).write_bytes(signature + garbage_data)
|
||||
|
||||
with self.assertRaises(ClassifierModelCorruptError):
|
||||
@@ -947,17 +944,9 @@ class TestClassifierSave:
|
||||
classifier.save()
|
||||
|
||||
raw = model_file.read_bytes()
|
||||
signature = raw[:HMAC_SIZE]
|
||||
data = raw[HMAC_SIZE:]
|
||||
# Computed independently so the on-disk format stays what is documented
|
||||
assert (
|
||||
signature
|
||||
== hmac.new(
|
||||
settings.SECRET_KEY.encode(),
|
||||
data,
|
||||
hashlib.sha256,
|
||||
).digest()
|
||||
)
|
||||
signature = raw[: DocumentClassifier.HMAC_SIZE]
|
||||
data = raw[DocumentClassifier.HMAC_SIZE :]
|
||||
assert signature == DocumentClassifier._compute_hmac(data)
|
||||
# A pickle opens with the PROTO opcode followed by the protocol number
|
||||
assert data[:2] == bytes([pickle.PROTO[0], pickle.HIGHEST_PROTOCOL])
|
||||
assert pickle.loads(data)[:3] == (
|
||||
|
||||
@@ -434,9 +434,13 @@ class ShareLinkBundleBuildTaskTests(DirectoriesMixin, APITestCase):
|
||||
"documents.tasks.OriginalsOnlyStrategy.add_document",
|
||||
side_effect=RuntimeError("zip failure"),
|
||||
),
|
||||
self.assertRaises(RuntimeError),
|
||||
mock.patch("pathlib.Path.unlink") as unlink_mock,
|
||||
):
|
||||
build_share_link_bundle(bundle.pk)
|
||||
unlink_mock.side_effect = [OSError("unlink"), OSError("unlink-finally")] + [
|
||||
None,
|
||||
] * 5
|
||||
with self.assertRaises(RuntimeError):
|
||||
build_share_link_bundle(bundle.pk)
|
||||
|
||||
bundle.refresh_from_db()
|
||||
self.assertEqual(bundle.status, ShareLinkBundle.Status.FAILED)
|
||||
@@ -444,6 +448,10 @@ class ShareLinkBundleBuildTaskTests(DirectoriesMixin, APITestCase):
|
||||
assert isinstance(bundle.last_error, dict)
|
||||
self.assertEqual(bundle.last_error.get("message"), "zip failure")
|
||||
self.assertEqual(bundle.last_error.get("exception_type"), "RuntimeError")
|
||||
scratch_zips = list(Path(settings.SCRATCH_DIR).glob("*.zip"))
|
||||
self.assertTrue(scratch_zips)
|
||||
for path in scratch_zips:
|
||||
path.unlink(missing_ok=True)
|
||||
|
||||
def test_build_share_link_bundle_missing_bundle_noop(self) -> None:
|
||||
# Should not raise when bundle does not exist
|
||||
|
||||
+20
-116
@@ -942,7 +942,7 @@ class EmailDocumentDetailSchema(EmailSerializer):
|
||||
parameters=[
|
||||
OpenApiParameter(
|
||||
name="id",
|
||||
type=OpenApiTypes.INT,
|
||||
type=OpenApiTypes.STR,
|
||||
location=OpenApiParameter.PATH,
|
||||
),
|
||||
],
|
||||
@@ -1036,14 +1036,6 @@ class DocumentViewSet(
|
||||
# Bound the IN clauses used for search results and through-table lookups.
|
||||
selection_data_batch_size = 10_000
|
||||
|
||||
def initial(self, request, *args, **kwargs):
|
||||
super().initial(request, *args, **kwargs)
|
||||
# Only ASCII digits can be a document id, reject anything else here, before
|
||||
# any action calls int() on it
|
||||
pk = kwargs.get("pk")
|
||||
if pk is not None and not (pk.isascii() and pk.isdigit()):
|
||||
raise Http404
|
||||
|
||||
def _get_selection_data_for_queryset(
|
||||
self,
|
||||
queryset: QuerySet[Document],
|
||||
@@ -2213,7 +2205,7 @@ class DocumentViewSet(
|
||||
raise Http404
|
||||
|
||||
try:
|
||||
doc_name, doc_file = serializer.validated_data.get("document")
|
||||
doc_name, doc_data = serializer.validated_data.get("document")
|
||||
version_label = serializer.validated_data.get("version_label")
|
||||
|
||||
t = int(mktime(datetime.now().timetuple()))
|
||||
@@ -2224,9 +2216,7 @@ class DocumentViewSet(
|
||||
pathvalidate.sanitize_filename(doc_name),
|
||||
)
|
||||
|
||||
with temp_file_path.open("wb") as scratch_file:
|
||||
for chunk in doc_file.chunks():
|
||||
scratch_file.write(chunk)
|
||||
temp_file_path.write_bytes(doc_data)
|
||||
|
||||
os.utime(temp_file_path, times=(t, t))
|
||||
|
||||
@@ -2894,13 +2884,6 @@ class UnifiedSearchViewSet(DocumentViewSet):
|
||||
return Response(max_asn + 1)
|
||||
|
||||
|
||||
LOG_FILES = {
|
||||
"paperless": "paperless.log",
|
||||
"mail": "mail.log",
|
||||
"celery": "celery.log",
|
||||
}
|
||||
|
||||
|
||||
@extend_schema_view(
|
||||
list=extend_schema(
|
||||
description="Logs view",
|
||||
@@ -2918,7 +2901,6 @@ LOG_FILES = {
|
||||
name="id",
|
||||
type=OpenApiTypes.STR,
|
||||
location=OpenApiParameter.PATH,
|
||||
enum=list(LOG_FILES),
|
||||
),
|
||||
OpenApiParameter(
|
||||
name="limit",
|
||||
@@ -2939,12 +2921,18 @@ LOG_FILES = {
|
||||
class LogViewSet(ViewSet):
|
||||
permission_classes = (IsAuthenticated, PaperlessAdminPermissions)
|
||||
|
||||
ALLOWED_LOG_FILES = {
|
||||
"paperless": "paperless.log",
|
||||
"mail": "mail.log",
|
||||
"celery": "celery.log",
|
||||
}
|
||||
|
||||
def get_log_file(self, log_key: str) -> Path:
|
||||
return Path(settings.LOGGING_DIR) / LOG_FILES[log_key]
|
||||
return Path(settings.LOGGING_DIR) / self.ALLOWED_LOG_FILES[log_key]
|
||||
|
||||
def retrieve(self, request, *args, **kwargs):
|
||||
log_key = kwargs.get("pk")
|
||||
if log_key not in LOG_FILES:
|
||||
if log_key not in self.ALLOWED_LOG_FILES:
|
||||
raise Http404
|
||||
|
||||
log_file = self.get_log_file(log_key)
|
||||
@@ -2973,7 +2961,9 @@ class LogViewSet(ViewSet):
|
||||
|
||||
def list(self, request, *args, **kwargs):
|
||||
existing_logs = [
|
||||
log_key for log_key in LOG_FILES if self.get_log_file(log_key).is_file()
|
||||
log_key
|
||||
for log_key in self.ALLOWED_LOG_FILES
|
||||
if self.get_log_file(log_key).is_file()
|
||||
]
|
||||
return Response(existing_logs)
|
||||
|
||||
@@ -3508,7 +3498,7 @@ class PostDocumentView(GenericAPIView[Any]):
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
doc_name, doc_file = serializer.validated_data.get("document")
|
||||
doc_name, doc_data = serializer.validated_data.get("document")
|
||||
doc_name = normalize("NFC", doc_name)
|
||||
correspondent_id = serializer.validated_data.get("correspondent")
|
||||
document_type_id = serializer.validated_data.get("document_type")
|
||||
@@ -3528,9 +3518,7 @@ class PostDocumentView(GenericAPIView[Any]):
|
||||
pathvalidate.sanitize_filename(doc_name),
|
||||
)
|
||||
|
||||
with temp_file_path.open("wb") as scratch_file:
|
||||
for chunk in doc_file.chunks():
|
||||
scratch_file.write(chunk)
|
||||
temp_file_path.write_bytes(doc_data)
|
||||
|
||||
os.utime(temp_file_path, times=(t, t))
|
||||
|
||||
@@ -3745,10 +3733,7 @@ class SearchAutoCompleteView(GenericAPIView[Any]):
|
||||
return HttpResponseBadRequest("Term required")
|
||||
|
||||
if "limit" in request.query_params:
|
||||
try:
|
||||
limit = int(request.query_params["limit"])
|
||||
except ValueError:
|
||||
return HttpResponseBadRequest("Invalid limit")
|
||||
limit = int(request.query_params["limit"])
|
||||
if limit <= 0:
|
||||
return HttpResponseBadRequest("Invalid limit")
|
||||
else:
|
||||
@@ -4024,36 +4009,7 @@ class GlobalSearchView(PassUserMixin):
|
||||
get=extend_schema(
|
||||
description="Get statistics for the current user",
|
||||
responses={
|
||||
(200, "application/json"): inline_serializer(
|
||||
name="Statistics",
|
||||
fields={
|
||||
"documents_total": serializers.IntegerField(),
|
||||
"documents_inbox": serializers.IntegerField(allow_null=True),
|
||||
"inbox_tag": serializers.IntegerField(
|
||||
allow_null=True,
|
||||
help_text="The first inbox tag, kept for backwards compatibility",
|
||||
),
|
||||
"inbox_tags": serializers.ListField(
|
||||
child=serializers.IntegerField(),
|
||||
allow_null=True,
|
||||
),
|
||||
"document_file_type_counts": serializers.ListField(
|
||||
child=inline_serializer(
|
||||
name="MimeTypeCount",
|
||||
fields={
|
||||
"mime_type": serializers.CharField(),
|
||||
"mime_type_count": serializers.IntegerField(),
|
||||
},
|
||||
),
|
||||
),
|
||||
"character_count": serializers.IntegerField(),
|
||||
"tag_count": serializers.IntegerField(),
|
||||
"correspondent_count": serializers.IntegerField(),
|
||||
"document_type_count": serializers.IntegerField(),
|
||||
"storage_path_count": serializers.IntegerField(),
|
||||
"current_asn": serializers.IntegerField(),
|
||||
},
|
||||
),
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
},
|
||||
),
|
||||
)
|
||||
@@ -4538,13 +4494,7 @@ def get_github_stars() -> int | None:
|
||||
get=extend_schema(
|
||||
description="Get the current version of the Paperless-NGX server",
|
||||
responses={
|
||||
(200, "application/json"): inline_serializer(
|
||||
name="RemoteVersion",
|
||||
fields={
|
||||
"version": serializers.CharField(),
|
||||
"update_available": serializers.BooleanField(),
|
||||
},
|
||||
),
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
},
|
||||
),
|
||||
)
|
||||
@@ -4609,17 +4559,7 @@ class RemoteVersionView(GenericAPIView[Any]):
|
||||
),
|
||||
],
|
||||
responses={
|
||||
(200, "application/json"): inline_serializer(
|
||||
name="ReleaseNotes",
|
||||
fields={
|
||||
"version": serializers.CharField(),
|
||||
"releases": serializers.ListField(
|
||||
child=serializers.DictField(),
|
||||
help_text="GitHub release objects",
|
||||
),
|
||||
"stars": serializers.IntegerField(allow_null=True),
|
||||
},
|
||||
),
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
},
|
||||
),
|
||||
)
|
||||
@@ -5883,26 +5823,6 @@ class SystemStatusView(PassUserMixin):
|
||||
)
|
||||
|
||||
|
||||
@extend_schema_view(
|
||||
get=extend_schema(
|
||||
description="List the documents in the trash",
|
||||
responses={(200, "application/json"): DocumentSerializer(many=True)},
|
||||
),
|
||||
post=extend_schema(
|
||||
description="Restore documents from the trash, or delete them permanently",
|
||||
responses={
|
||||
(200, "application/json"): inline_serializer(
|
||||
name="TrashActionResult",
|
||||
fields={
|
||||
"result": serializers.CharField(),
|
||||
"doc_ids": serializers.ListField(
|
||||
child=serializers.IntegerField(),
|
||||
),
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
)
|
||||
class TrashView(ListModelMixin, PassUserMixin):
|
||||
permission_classes = (IsAuthenticated, TrashPermissions)
|
||||
serializer_class = TrashSerializer
|
||||
@@ -6051,22 +5971,6 @@ class OcrTemplateViewSet(BulkPermissionMixin, PassUserMixin, ModelViewSet[OcrTem
|
||||
]
|
||||
return super().get_permissions()
|
||||
|
||||
@extend_schema(
|
||||
parameters=[
|
||||
OpenApiParameter(
|
||||
name="doc_id",
|
||||
type=OpenApiTypes.INT,
|
||||
location=OpenApiParameter.PATH,
|
||||
),
|
||||
OpenApiParameter(
|
||||
name="page",
|
||||
type={"type": "integer", "minimum": 1},
|
||||
location=OpenApiParameter.PATH,
|
||||
description="1-based page number",
|
||||
),
|
||||
],
|
||||
responses={(200, "image/png"): OpenApiTypes.BINARY},
|
||||
)
|
||||
@action(
|
||||
detail=False,
|
||||
methods=["get"],
|
||||
|
||||
@@ -2,7 +2,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ngx\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-11-30 18:39+0000\n"
|
||||
"POT-Creation-Date: 2026-11-27 02:54+0000\n"
|
||||
"PO-Revision-Date: 2022-02-17 04:17\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: English\n"
|
||||
@@ -1879,49 +1879,49 @@ msgstr ""
|
||||
msgid "OCR template zones"
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:495 documents/serialisers.py:819
|
||||
#: documents/serialisers.py:2918 documents/views.py:372 documents/views.py:638
|
||||
#: documents/views.py:2878 paperless_mail/serialisers.py:145
|
||||
#: documents/serialisers.py:491 documents/serialisers.py:815
|
||||
#: documents/serialisers.py:2913 documents/views.py:372 documents/views.py:638
|
||||
#: documents/views.py:2868 paperless_mail/serialisers.py:145
|
||||
msgid "Insufficient permissions."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:651
|
||||
#: documents/serialisers.py:647
|
||||
msgid "Invalid color."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2385
|
||||
#: documents/serialisers.py:2380
|
||||
#, python-format
|
||||
msgid "File type %(type)s not supported"
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2429
|
||||
#: documents/serialisers.py:2424
|
||||
#, python-format
|
||||
msgid "Custom field id must be an integer: %(id)s"
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2436
|
||||
#: documents/serialisers.py:2431
|
||||
#, python-format
|
||||
msgid "Custom field with id %(id)s does not exist"
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2453 documents/serialisers.py:2463
|
||||
#: documents/serialisers.py:2448 documents/serialisers.py:2458
|
||||
msgid ""
|
||||
"Custom fields must be a list of integers or an object mapping ids to values."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2458
|
||||
#: documents/serialisers.py:2453
|
||||
msgid "Some custom fields don't exist or were specified twice."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2605
|
||||
#: documents/serialisers.py:2600
|
||||
msgid "Invalid variable detected."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2974
|
||||
#: documents/serialisers.py:2969
|
||||
msgid "Duplicate document identifiers are not allowed."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:3004 documents/views.py:5061
|
||||
#: documents/serialisers.py:2999 documents/views.py:5001
|
||||
#, python-format
|
||||
msgid "Documents not found: %(ids)s"
|
||||
msgstr ""
|
||||
@@ -2192,36 +2192,36 @@ msgstr ""
|
||||
msgid "Specify only one of text, title_search, query, or more_like_id."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:365 documents/views.py:2875
|
||||
#: documents/views.py:365 documents/views.py:2865
|
||||
msgid "Invalid more_like_id"
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:1705
|
||||
#: documents/views.py:1697
|
||||
msgid "Invalid AI configuration."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:1716
|
||||
#: documents/views.py:1708
|
||||
msgid "AI backend request timed out."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:1728
|
||||
#: documents/views.py:1720
|
||||
msgid "AI backend rejected the request. Check logs for details."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:5077
|
||||
#: documents/views.py:5017
|
||||
#, python-format
|
||||
msgid "Insufficient permissions to share document %(id)s."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:5124
|
||||
#: documents/views.py:5064
|
||||
msgid "Bundle is already being processed."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:5190
|
||||
#: documents/views.py:5130
|
||||
msgid "The share link bundle is still being prepared. Please try again later."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:5204
|
||||
#: documents/views.py:5144
|
||||
msgid "The share link bundle is unavailable."
|
||||
msgstr ""
|
||||
|
||||
@@ -2661,7 +2661,7 @@ msgstr ""
|
||||
msgid "Chinese Traditional"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:455
|
||||
#: paperless/urls.py:452
|
||||
msgid "Paperless-ngx administration"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
from paperless.signed_pickle import SignedPickleError
|
||||
from paperless.signed_pickle import signed_pickle_dumps
|
||||
from paperless.signed_pickle import signed_pickle_loads
|
||||
|
||||
logger = logging.getLogger("paperless.cache")
|
||||
|
||||
|
||||
class SignedRedisSerializer:
|
||||
"""
|
||||
Cache serializer for Django's RedisCache which HMAC-signs every pickled value.
|
||||
|
||||
Django's default serializer unpickles whatever it finds under a key, so anything
|
||||
able to write to the Redis instance could get code run in the web server, for
|
||||
example through a session entry. Values are signed with SECRET_KEY on write and
|
||||
verified before unpickling on read, the same protection the Celery messages on
|
||||
the same broker have.
|
||||
|
||||
An entry that fails verification is dropped and reported as a cache miss.
|
||||
"""
|
||||
|
||||
def dumps(self, obj: Any) -> bytes | int:
|
||||
# Like Django's own serializer, keep plain integers unpickled so incr() and
|
||||
# decr() stay atomic. Using type() rather than isinstance() excludes bool.
|
||||
if type(obj) is int:
|
||||
return obj
|
||||
return signed_pickle_dumps(obj)
|
||||
|
||||
def loads(self, data: bytes) -> Any:
|
||||
try:
|
||||
return int(data)
|
||||
except ValueError:
|
||||
pass
|
||||
try:
|
||||
return signed_pickle_loads(data)
|
||||
except SignedPickleError:
|
||||
logger.warning("Ignoring cache entry with an invalid signature")
|
||||
return None
|
||||
@@ -374,19 +374,15 @@ class TikaDocumentParser:
|
||||
|
||||
try:
|
||||
parsed = self._tika_client.metadata.from_file(document_path, mime_type)
|
||||
metadata: list[MetadataEntry] = []
|
||||
for key, value in parsed.data.items():
|
||||
if isinstance(value, list):
|
||||
value = " ".join(str(item) for item in value)
|
||||
metadata.append(
|
||||
{
|
||||
"namespace": "",
|
||||
"prefix": "",
|
||||
"key": key,
|
||||
"value": str(value),
|
||||
},
|
||||
)
|
||||
return metadata
|
||||
return [
|
||||
{
|
||||
"namespace": "",
|
||||
"prefix": "",
|
||||
"key": key,
|
||||
"value": parsed.data[key],
|
||||
}
|
||||
for key in parsed.data
|
||||
]
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
"Error while fetching document metadata for %s: %s",
|
||||
|
||||
@@ -364,14 +364,13 @@ def extract_pdf_metadata(
|
||||
namespace_pattern = re.compile(r"\{(.*)\}(.*)")
|
||||
|
||||
try:
|
||||
with pikepdf.open(document_path) as pdf:
|
||||
meta = pdf.open_metadata()
|
||||
items = list(meta.items())
|
||||
pdf = pikepdf.open(document_path)
|
||||
meta = pdf.open_metadata()
|
||||
except Exception as e:
|
||||
_log.warning("Could not open PDF metadata for %s: %s", document_path, e)
|
||||
return []
|
||||
|
||||
for key, value in items:
|
||||
for key, value in meta.items():
|
||||
if isinstance(value, list):
|
||||
value = " ".join(str(e) for e in value)
|
||||
value = str(value)
|
||||
|
||||
@@ -365,8 +365,3 @@ class ApplicationConfigurationSerializer(
|
||||
class Meta:
|
||||
model = ApplicationConfiguration
|
||||
fields = "__all__"
|
||||
|
||||
|
||||
class TOTPActivationSerializer(serializers.Serializer[dict[str, str]]):
|
||||
secret = serializers.CharField()
|
||||
code = serializers.CharField()
|
||||
@@ -807,23 +807,17 @@ _CACHE_BACKEND = os.environ.get(
|
||||
)
|
||||
|
||||
|
||||
# Entries are HMAC-signed so values planted in Redis are never unpickled
|
||||
_CACHE_OPTIONS = {"serializer": "paperless.cache.SignedRedisSerializer"}
|
||||
|
||||
|
||||
def _parse_caches():
|
||||
return {
|
||||
"default": {
|
||||
"BACKEND": _CACHE_BACKEND,
|
||||
"LOCATION": _CHANNELS_REDIS_URL,
|
||||
"KEY_PREFIX": _REDIS_KEY_PREFIX,
|
||||
"OPTIONS": _CACHE_OPTIONS,
|
||||
},
|
||||
"read-cache": {
|
||||
"BACKEND": _CACHE_BACKEND,
|
||||
"LOCATION": cachalot_settings["CACHALOT_REDIS_URL"],
|
||||
"KEY_PREFIX": _REDIS_KEY_PREFIX,
|
||||
"OPTIONS": _CACHE_OPTIONS,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -3,17 +3,10 @@ from __future__ import annotations
|
||||
import hmac
|
||||
import pickle
|
||||
from hashlib import sha256
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import Any
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
from types import TracebackType
|
||||
from typing import BinaryIO
|
||||
from typing import Self
|
||||
|
||||
HMAC_SIZE = sha256().digest_size
|
||||
|
||||
|
||||
@@ -21,91 +14,26 @@ class SignedPickleError(ValueError):
|
||||
"""Raised when a signed pickle payload cannot be authenticated."""
|
||||
|
||||
|
||||
def new_mac() -> hmac.HMAC:
|
||||
"""
|
||||
A new HMAC-SHA256 keyed with the SECRET_KEY, for signing incrementally.
|
||||
"""
|
||||
return hmac.new(settings.SECRET_KEY.encode(), digestmod=sha256)
|
||||
|
||||
|
||||
def compute_signature(data: bytes | memoryview) -> bytes:
|
||||
mac = new_mac()
|
||||
mac.update(data)
|
||||
return mac.digest()
|
||||
|
||||
|
||||
def verify_signed(payload: bytes | memoryview) -> memoryview:
|
||||
"""
|
||||
Verifies a payload made of an HMAC signature followed by the data, returning
|
||||
a view of the data.
|
||||
|
||||
The data is sliced through a memoryview, so a (potentially multi-GB) payload
|
||||
is not copied. The view is only returned once the whole payload has been
|
||||
verified, and callers should unpickle from it rather than from the source,
|
||||
so what is loaded is exactly what was checked.
|
||||
"""
|
||||
if len(payload) <= HMAC_SIZE:
|
||||
msg = "Signed-pickle payload too short"
|
||||
raise SignedPickleError(msg)
|
||||
|
||||
view = memoryview(payload)
|
||||
signature = view[:HMAC_SIZE]
|
||||
data = view[HMAC_SIZE:]
|
||||
if not hmac.compare_digest(signature, compute_signature(data)):
|
||||
msg = "Signed-pickle HMAC verification failed; payload may have been tampered with"
|
||||
raise SignedPickleError(msg)
|
||||
|
||||
return data
|
||||
def _get_signing_key() -> bytes:
|
||||
return settings.SECRET_KEY.encode()
|
||||
|
||||
|
||||
def signed_pickle_dumps(obj: object) -> bytes:
|
||||
data = pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
|
||||
return compute_signature(data) + data
|
||||
signature = hmac.new(_get_signing_key(), data, sha256).digest()
|
||||
return signature + data
|
||||
|
||||
|
||||
def signed_pickle_loads(payload: bytes) -> Any:
|
||||
return pickle.loads(verify_signed(payload))
|
||||
if len(payload) <= HMAC_SIZE:
|
||||
msg = "Signed-pickle payload too short"
|
||||
raise SignedPickleError(msg)
|
||||
|
||||
signature = payload[:HMAC_SIZE]
|
||||
data = payload[HMAC_SIZE:]
|
||||
expected = hmac.new(_get_signing_key(), data, sha256).digest()
|
||||
if not hmac.compare_digest(signature, expected):
|
||||
msg = "Signed-pickle HMAC verification failed; payload may have been tampered with"
|
||||
raise SignedPickleError(msg)
|
||||
|
||||
class SignedFileWriter:
|
||||
"""
|
||||
Atomically writes a file made of an HMAC signature followed by the data,
|
||||
signing the data as it streams to disk rather than holding it in memory.
|
||||
The result can be read back with verify_signed.
|
||||
|
||||
The signature is only known once everything is written, so its space is
|
||||
reserved at the start of the file and filled in on exit. The target is only
|
||||
replaced once the file is complete; on error the partial file is removed.
|
||||
"""
|
||||
|
||||
def __init__(self, target: Path) -> None:
|
||||
self._target = target
|
||||
self._temp = target.with_name(f"{target.name}.part")
|
||||
self._mac = new_mac()
|
||||
self._file: BinaryIO
|
||||
|
||||
def __enter__(self) -> Self:
|
||||
self._file = self._temp.open("wb")
|
||||
self._file.write(bytes(HMAC_SIZE))
|
||||
return self
|
||||
|
||||
def write(self, data: bytes | memoryview) -> int:
|
||||
self._mac.update(data)
|
||||
return self._file.write(data)
|
||||
|
||||
def __exit__(
|
||||
self,
|
||||
exc_type: type[BaseException] | None,
|
||||
exc_value: BaseException | None,
|
||||
traceback: TracebackType | None,
|
||||
) -> None:
|
||||
try:
|
||||
with self._file:
|
||||
if exc_type is None:
|
||||
self._file.seek(0)
|
||||
self._file.write(self._mac.digest())
|
||||
if exc_type is None:
|
||||
self._temp.rename(self._target)
|
||||
finally:
|
||||
# A no-op after a successful rename, otherwise removes the partial file
|
||||
self._temp.unlink(missing_ok=True)
|
||||
return pickle.loads(data)
|
||||
@@ -131,10 +131,8 @@ class TestTikaParser:
|
||||
httpx_mock.add_response(
|
||||
json={
|
||||
"Content-Type": "application/vnd.oasis.opendocument.text",
|
||||
"X-TIKA:Parsed-By": ["ParserA", "ParserB"],
|
||||
"X-TIKA:Parsed-By-Full-Set": [],
|
||||
"X-TIKA:Parsed-By": [],
|
||||
"Some-key": "value",
|
||||
"meta:page-count": 2,
|
||||
"dcterms:created": "2020-11-21T00:00:00",
|
||||
},
|
||||
)
|
||||
@@ -146,11 +144,6 @@ class TestTikaParser:
|
||||
|
||||
assert "dcterms:created" in [m["key"] for m in metadata]
|
||||
assert "Some-key" in [m["key"] for m in metadata]
|
||||
values = {entry["key"]: entry["value"] for entry in metadata}
|
||||
assert values["X-TIKA:Parsed-By"] == "ParserA ParserB"
|
||||
assert values["X-TIKA:Parsed-By-Full-Set"] == ""
|
||||
assert values["meta:page-count"] == "2"
|
||||
assert all(isinstance(value, str) for value in values.values())
|
||||
|
||||
def test_convert_failure(
|
||||
self,
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
import pytest
|
||||
from django.test import Client
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
|
||||
class TestUnmatchedApiPaths:
|
||||
@pytest.mark.parametrize("method", ["get", "post", "put", "patch", "delete"])
|
||||
def test_unmatched_api_path_is_a_json_404(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
method: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An unauthenticated client
|
||||
WHEN:
|
||||
- Any method is sent to an /api/ URL that no route matches
|
||||
THEN:
|
||||
- The response is a JSON 404, not a redirect to the login page
|
||||
"""
|
||||
response = getattr(rest_api_client, method)("/api/this_does_not_exist/")
|
||||
|
||||
assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||
assert response["Content-Type"].startswith("application/json")
|
||||
|
||||
def test_unmatched_api_path_is_a_json_404_when_authenticated(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- An /api/ URL that no route matches is requested
|
||||
THEN:
|
||||
- The response is a JSON 404, not the frontend page
|
||||
"""
|
||||
response = admin_client.get("/api/this/is/nested/and/missing/")
|
||||
|
||||
assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||
assert response["Content-Type"].startswith("application/json")
|
||||
|
||||
def test_other_paths_still_reach_the_frontend_catch_all(
|
||||
self,
|
||||
client: Client,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An anonymous browser request
|
||||
WHEN:
|
||||
- A non-API path is requested
|
||||
THEN:
|
||||
- The frontend catch-all still applies, which sends the user to log in
|
||||
"""
|
||||
response = client.get("/documents/")
|
||||
|
||||
assert response.status_code == status.HTTP_302_FOUND
|
||||
assert "login" in response["Location"]
|
||||
|
||||
|
||||
class TestDocumentRouteIds:
|
||||
@pytest.mark.parametrize(
|
||||
"action",
|
||||
[
|
||||
"download",
|
||||
"history",
|
||||
"metadata",
|
||||
"notes",
|
||||
"preview",
|
||||
"root",
|
||||
"share_links",
|
||||
"suggestions",
|
||||
"thumb",
|
||||
],
|
||||
)
|
||||
@pytest.mark.parametrize("pk", ["null", "true", "abc", "0.5", "%20"])
|
||||
def test_non_numeric_document_id_is_a_json_404(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
action: str,
|
||||
pk: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A document sub-route is requested with an id that is not a number
|
||||
THEN:
|
||||
- The response is a JSON 404, not a server error
|
||||
"""
|
||||
response = admin_client.get(f"/api/documents/{pk}/{action}/")
|
||||
|
||||
assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||
assert response["Content-Type"].startswith("application/json")
|
||||
@@ -1,39 +0,0 @@
|
||||
import pytest
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
|
||||
class TestTotpView:
|
||||
def test_options_does_not_fail(self, admin_client: APIClient) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- OPTIONS is sent to the TOTP endpoint
|
||||
THEN:
|
||||
- The request succeeds, DRF's metadata needs a serializer on the view
|
||||
"""
|
||||
response = admin_client.options("/api/profile/totp/")
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"body",
|
||||
[{}, {"secret": "abc"}, {"code": "123456"}, {"secret": None, "code": None}],
|
||||
)
|
||||
def test_activation_with_missing_fields_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
body: dict[str, str | None],
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- TOTP is activated without both the secret and the code
|
||||
THEN:
|
||||
- The response is a 400, not a server error
|
||||
"""
|
||||
response = admin_client.post("/api/profile/totp/", body, format="json")
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
@@ -1,126 +0,0 @@
|
||||
import pickle
|
||||
from collections.abc import Callable
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
from django.conf import settings
|
||||
|
||||
from paperless.cache import SignedRedisSerializer
|
||||
from paperless.signed_pickle import compute_signature
|
||||
|
||||
|
||||
class _Evil:
|
||||
def __init__(self, marker: Path) -> None:
|
||||
self.marker = marker
|
||||
|
||||
def __reduce__(self) -> tuple[Any, tuple[str]]:
|
||||
return (self.marker.write_text, ("pwned",))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def serializer() -> SignedRedisSerializer:
|
||||
return SignedRedisSerializer()
|
||||
|
||||
|
||||
class TestSignedRedisSerializer:
|
||||
def test_round_trip(self, serializer: SignedRedisSerializer) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A nested value
|
||||
WHEN:
|
||||
- It is serialized and then deserialized
|
||||
THEN:
|
||||
- The original value is returned
|
||||
"""
|
||||
value = {"a": [1, 2, 3], "b": ("x", None)}
|
||||
|
||||
assert serializer.loads(serializer.dumps(value)) == value
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("value", "stored_type"),
|
||||
[
|
||||
pytest.param(7, int, id="int"),
|
||||
pytest.param(True, bytes, id="bool"),
|
||||
],
|
||||
)
|
||||
def test_only_plain_integers_are_stored_raw(
|
||||
self,
|
||||
serializer: SignedRedisSerializer,
|
||||
value: object,
|
||||
stored_type: type,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A plain integer or a bool
|
||||
WHEN:
|
||||
- The value is serialized
|
||||
THEN:
|
||||
- Only the integer is stored unpickled, so incr/decr stay atomic
|
||||
"""
|
||||
assert type(serializer.dumps(value)) is stored_type
|
||||
|
||||
def test_raw_integer_is_loaded(self, serializer: SignedRedisSerializer) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An integer as stored by Redis incr/decr
|
||||
WHEN:
|
||||
- It is deserialized
|
||||
THEN:
|
||||
- The integer is returned without signature verification
|
||||
"""
|
||||
assert serializer.loads(b"7") == 7
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"forge",
|
||||
[
|
||||
pytest.param(lambda data: data, id="unsigned"),
|
||||
pytest.param(
|
||||
lambda data: compute_signature(b"other data") + data,
|
||||
id="signature-for-other-data",
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_forged_pickle_is_not_loaded(
|
||||
self,
|
||||
serializer: SignedRedisSerializer,
|
||||
tmp_path: Path,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
forge: Callable[[bytes], bytes],
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A malicious pickle without a valid signature
|
||||
WHEN:
|
||||
- It is deserialized
|
||||
THEN:
|
||||
- It is treated as a cache miss, never executed, and a warning is logged
|
||||
"""
|
||||
marker = tmp_path / "marker"
|
||||
payload = forge(pickle.dumps(_Evil(marker)))
|
||||
|
||||
assert serializer.loads(payload) is None
|
||||
assert not marker.exists()
|
||||
assert "invalid signature" in caplog.text
|
||||
|
||||
|
||||
class TestCacheSettings:
|
||||
@pytest.mark.parametrize(
|
||||
"alias",
|
||||
[
|
||||
pytest.param("default", id="default"),
|
||||
pytest.param("read-cache", id="read-cache"),
|
||||
],
|
||||
)
|
||||
def test_caches_use_signed_serializer(self, alias: str) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- The configured cache aliases
|
||||
WHEN:
|
||||
- Their options are inspected
|
||||
THEN:
|
||||
- Each uses the signed serializer
|
||||
"""
|
||||
options = settings.CACHES[alias]["OPTIONS"]
|
||||
|
||||
assert options["serializer"] == "paperless.cache.SignedRedisSerializer"
|
||||
@@ -12,8 +12,6 @@ from django.test import override_settings
|
||||
from paperless.celery import signed_pickle_dumps
|
||||
from paperless.celery import signed_pickle_loads
|
||||
from paperless.signed_pickle import HMAC_SIZE
|
||||
from paperless.signed_pickle import compute_signature
|
||||
from paperless.signed_pickle import verify_signed
|
||||
|
||||
|
||||
def test_tasks_registered_without_system_checks() -> None:
|
||||
@@ -82,14 +80,6 @@ class TestSignedPickleSerializer:
|
||||
with pytest.raises(ValueError, match="HMAC verification failed"):
|
||||
signed_pickle_loads(bytes(tampered))
|
||||
|
||||
def test_verified_data_is_a_view_not_a_copy(self) -> None:
|
||||
"""Verified data is a view of the payload, so large payloads aren't copied."""
|
||||
data = b"x" * 1024
|
||||
payload = compute_signature(data) + data
|
||||
verified = verify_signed(payload)
|
||||
assert verified.obj is payload
|
||||
assert bytes(verified) == data
|
||||
|
||||
def test_truncated_payload_rejected(self) -> None:
|
||||
"""A payload shorter than HMAC_SIZE is rejected."""
|
||||
with pytest.raises(ValueError, match="too short"):
|
||||
|
||||
@@ -658,9 +658,9 @@ class TestUserGroupDeletionCleanup(TestCase):
|
||||
"permissions": {
|
||||
"default_owner": user2.id,
|
||||
"default_view_users": [user2.id],
|
||||
"default_edit_users": [user2.id],
|
||||
"default_change_users": [user2.id],
|
||||
"default_view_groups": [group.id],
|
||||
"default_edit_groups": [group.id],
|
||||
"default_change_groups": [group.id],
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -670,13 +670,13 @@ class TestUserGroupDeletionCleanup(TestCase):
|
||||
permissions = ui_settings.settings.get("permissions", {})
|
||||
self.assertIsNone(permissions.get("default_owner"))
|
||||
self.assertEqual(permissions.get("default_view_users"), [])
|
||||
self.assertEqual(permissions.get("default_edit_users"), [])
|
||||
self.assertEqual(permissions.get("default_change_users"), [])
|
||||
|
||||
group.delete()
|
||||
ui_settings.refresh_from_db()
|
||||
permissions = ui_settings.settings.get("permissions", {})
|
||||
self.assertEqual(permissions.get("default_view_groups"), [])
|
||||
self.assertEqual(permissions.get("default_edit_groups"), [])
|
||||
self.assertEqual(permissions.get("default_change_groups"), [])
|
||||
|
||||
def test_user_group_deletion_error_handling(self) -> None:
|
||||
"""
|
||||
|
||||
@@ -12,11 +12,6 @@ from paperless.utils import ocr_to_dateparser_languages
|
||||
pytest.param("eng", ["en"], id="single-language"),
|
||||
pytest.param("fra+ita+lao", ["fr", "it", "lo"], id="multiple-languages"),
|
||||
pytest.param("fil", ["fil"], id="no-two-letter-equivalent"),
|
||||
pytest.param(
|
||||
"afr+vie+kan+chr+mkd", # codespell:ignore
|
||||
["af", "vi", "kn", "chr", "mk"],
|
||||
id="previously-unmapped-languages",
|
||||
),
|
||||
pytest.param(
|
||||
"aze_cyrl+srp_latn",
|
||||
["az-Cyrl", "sr-Latn"],
|
||||
@@ -54,19 +49,6 @@ def test_ocr_to_dateparser_languages(ocr_language: str, expected: list[str]) ->
|
||||
assert sorted(ocr_to_dateparser_languages(ocr_language)) == sorted(expected)
|
||||
|
||||
|
||||
def test_ocr_to_dateparser_map_values_supported_by_dateparser() -> None:
|
||||
from dateparser.languages.loader import LocaleDataLoader
|
||||
|
||||
loader = LocaleDataLoader()
|
||||
unsupported = []
|
||||
for ocr_code, dateparser_code in utils.OCR_TO_DATEPARSER_LANGUAGES.items():
|
||||
try:
|
||||
loader.get_locale_map(locales=[dateparser_code])
|
||||
except Exception:
|
||||
unsupported.append((ocr_code, dateparser_code))
|
||||
assert unsupported == []
|
||||
|
||||
|
||||
def test_ocr_to_dateparser_languages_exception(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
|
||||
@@ -57,7 +57,6 @@ from documents.views import WorkflowTriggerViewSet
|
||||
from documents.views import WorkflowViewSet
|
||||
from documents.views import serve_logo
|
||||
from paperless.consumers import StatusConsumer
|
||||
from paperless.views import ApiNotFoundView
|
||||
from paperless.views import ApplicationConfigurationViewSet
|
||||
from paperless.views import DisconnectSocialAccountView
|
||||
from paperless.views import FaviconView
|
||||
@@ -310,8 +309,6 @@ urlpatterns = [
|
||||
RedirectView.as_view(url="schema/view/"),
|
||||
),
|
||||
*api_router.urls,
|
||||
# Must stay last, anything unmatched under /api/ is a JSON 404
|
||||
re_path(r"^.*$", ApiNotFoundView.as_view(), name="api_not_found"),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
+16
-16
@@ -2,18 +2,19 @@ import logging
|
||||
|
||||
logger = logging.getLogger("paperless.utils")
|
||||
|
||||
# Translation map from languages supported by Tesseract OCR
|
||||
# to languages supported by dateparser.
|
||||
# To add a language, make sure it is supported by both libraries.
|
||||
# The ISO 639-2 will help you link a 3-char to 2-char language code.
|
||||
# Links:
|
||||
# - Tesseract languages: https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions.html
|
||||
# - Python dateparser languages: https://dateparser.readthedocs.io/en/latest/supported_locales.html
|
||||
# - ISO 639-2: https://www.loc.gov/standards/iso639-2/php/code_list.php
|
||||
OCR_TO_DATEPARSER_LANGUAGES = {
|
||||
# These dateparser languages have no equivalent in any Tesseract release
|
||||
# (checked against tessdata, tessdata_best and tessdata_fast), so they cannot
|
||||
# be reached from the OCR language. Set PAPERLESS_DATE_PARSER_LANGUAGES to use them:
|
||||
"""
|
||||
Translation map from languages supported by Tesseract OCR
|
||||
to languages supported by dateparser.
|
||||
To add a language, make sure it is supported by both libraries.
|
||||
The ISO 639-2 will help you link a 3-char to 2-char language code.
|
||||
Links:
|
||||
- Tesseract languages: https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions.html
|
||||
- Python dateparser languages: https://dateparser.readthedocs.io/en/latest/supported_locales.html
|
||||
- ISO 639-2: https://www.loc.gov/standards/iso639-2/php/code_list.php
|
||||
"""
|
||||
# TODO check these Dateparser languages as they are not referenced on the ISO639-2 standard,
|
||||
# so we didn't find the equivalent in Tesseract:
|
||||
# agq, asa, bez, brx, cgg, ckb, dav, dje, dyo, ebu, guz, jgo, jmc, kde, kea, khq, kln,
|
||||
# ksb, ksf, ksh, lag, lkt, lrc, luy, mer, mfe, mgh, mgo, mua, mzn, naq, nmg, nnh, nus,
|
||||
# rof, rwk, saq, sbp, she, ses, shi, teo, twq, tzm, vun, wae, xog, yav, yue
|
||||
@@ -21,6 +22,7 @@ OCR_TO_DATEPARSER_LANGUAGES = {
|
||||
"amh": "am",
|
||||
"ara": "ar",
|
||||
"asm": "as",
|
||||
"ast": "ast",
|
||||
"aze": "az",
|
||||
"bel": "be",
|
||||
"bul": "bg",
|
||||
@@ -29,7 +31,7 @@ OCR_TO_DATEPARSER_LANGUAGES = {
|
||||
"bre": "br",
|
||||
"bos": "bs",
|
||||
"cat": "ca",
|
||||
"chr": "chr",
|
||||
"cher": "chr",
|
||||
"ces": "cs",
|
||||
"cym": "cy",
|
||||
"dan": "da",
|
||||
@@ -63,21 +65,19 @@ OCR_TO_DATEPARSER_LANGUAGES = {
|
||||
"kat": "ka",
|
||||
"kaz": "kk",
|
||||
"khm": "km",
|
||||
"kan": "kn",
|
||||
"knda": "kn",
|
||||
"kor": "ko",
|
||||
"kir": "ky",
|
||||
"ltz": "lb",
|
||||
"lao": "lo",
|
||||
"lit": "lt",
|
||||
"lav": "lv",
|
||||
"mkd": "mk",
|
||||
"mal": "ml",
|
||||
"mon": "mn",
|
||||
"mar": "mr",
|
||||
"msa": "ms",
|
||||
"mlt": "mt",
|
||||
"mya": "my",
|
||||
"nor": "nb",
|
||||
"nep": "ne",
|
||||
"nld": "nl",
|
||||
"ori": "or",
|
||||
@@ -106,7 +106,7 @@ OCR_TO_DATEPARSER_LANGUAGES = {
|
||||
"ukr": "uk",
|
||||
"urd": "ur",
|
||||
"uzb": "uz",
|
||||
"vie": "vi", # codespell:ignore
|
||||
"via": "vi",
|
||||
"yid": "yi",
|
||||
"yor": "yo",
|
||||
"chi": "zh",
|
||||
|
||||
+6
-55
@@ -24,12 +24,9 @@ from django_filters.rest_framework import DjangoFilterBackend
|
||||
from drf_spectacular.types import OpenApiTypes
|
||||
from drf_spectacular.utils import extend_schema
|
||||
from drf_spectacular.utils import extend_schema_view
|
||||
from drf_spectacular.utils import inline_serializer
|
||||
from rest_framework import serializers
|
||||
from rest_framework.authtoken.models import Token
|
||||
from rest_framework.authtoken.views import ObtainAuthToken
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.exceptions import NotFound
|
||||
from rest_framework.exceptions import ValidationError
|
||||
from rest_framework.fields import BooleanField
|
||||
from rest_framework.filters import OrderingFilter
|
||||
@@ -38,7 +35,6 @@ from rest_framework.pagination import PageNumberPagination
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.throttling import ScopedRateThrottle
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework.viewsets import ModelViewSet
|
||||
|
||||
from documents.models import PaperlessTask
|
||||
@@ -53,7 +49,6 @@ from paperless.serialisers import ApplicationConfigurationSerializer
|
||||
from paperless.serialisers import GroupSerializer
|
||||
from paperless.serialisers import PaperlessAuthTokenSerializer
|
||||
from paperless.serialisers import ProfileSerializer
|
||||
from paperless.serialisers import TOTPActivationSerializer
|
||||
from paperless.serialisers import UserSerializer
|
||||
|
||||
|
||||
@@ -279,16 +274,8 @@ class ProfileView(GenericAPIView[Any]):
|
||||
|
||||
@extend_schema_view(
|
||||
get=extend_schema(
|
||||
description="Generate a new TOTP secret, its otpauth URL and a QR code",
|
||||
responses={
|
||||
(200, "application/json"): inline_serializer(
|
||||
name="TotpSetup",
|
||||
fields={
|
||||
"url": serializers.CharField(),
|
||||
"qr_svg": serializers.CharField(help_text="QR code as an SVG"),
|
||||
"secret": serializers.CharField(),
|
||||
},
|
||||
),
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
},
|
||||
),
|
||||
post=extend_schema(
|
||||
@@ -303,17 +290,7 @@ class ProfileView(GenericAPIView[Any]):
|
||||
},
|
||||
},
|
||||
responses={
|
||||
(200, "application/json"): inline_serializer(
|
||||
name="TotpActivation",
|
||||
fields={
|
||||
"success": serializers.BooleanField(),
|
||||
"recovery_codes": serializers.ListField(
|
||||
child=serializers.CharField(),
|
||||
allow_null=True,
|
||||
help_text="Only returned when the code was valid",
|
||||
),
|
||||
},
|
||||
),
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
},
|
||||
),
|
||||
delete=extend_schema(
|
||||
@@ -329,7 +306,6 @@ class TOTPView(GenericAPIView[Any]):
|
||||
"""
|
||||
|
||||
permission_classes = [IsAuthenticated]
|
||||
serializer_class = TOTPActivationSerializer
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
"""
|
||||
@@ -352,18 +328,15 @@ class TOTPView(GenericAPIView[Any]):
|
||||
"""
|
||||
Validates a TOTP code and activates the TOTP authenticator
|
||||
"""
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
secret = serializer.validated_data["secret"]
|
||||
valid = totp_auth.validate_totp_code(
|
||||
secret,
|
||||
serializer.validated_data["code"],
|
||||
request.data["secret"],
|
||||
request.data["code"],
|
||||
)
|
||||
recovery_codes = None
|
||||
if valid:
|
||||
auth = totp_auth.TOTP.activate(
|
||||
request.user,
|
||||
secret,
|
||||
request.data["secret"],
|
||||
).instance
|
||||
signals.authenticator_added.send(
|
||||
sender=Authenticator,
|
||||
@@ -550,14 +523,7 @@ class DisconnectSocialAccountView(GenericAPIView[Any]):
|
||||
@extend_schema_view(
|
||||
get=extend_schema(
|
||||
responses={
|
||||
(200, "application/json"): inline_serializer(
|
||||
name="SocialAccountProvider",
|
||||
fields={
|
||||
"name": serializers.CharField(),
|
||||
"login_url": serializers.CharField(),
|
||||
},
|
||||
many=True,
|
||||
),
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
},
|
||||
),
|
||||
)
|
||||
@@ -591,18 +557,3 @@ class SocialAccountProvidersView(GenericAPIView[Any]):
|
||||
]
|
||||
|
||||
return Response(sorted(resp, key=lambda p: p["name"]))
|
||||
|
||||
|
||||
@extend_schema(exclude=True)
|
||||
class ApiNotFoundView(APIView):
|
||||
"""
|
||||
A JSON 404 for any /api/ URL that no other route matches. Without this, those
|
||||
URLs fall through to the frontend catch-all, which answers a redirect to the
|
||||
login page or the single page app, never an error an API client can read.
|
||||
"""
|
||||
|
||||
authentication_classes = ()
|
||||
permission_classes = ()
|
||||
|
||||
def initial(self, request, *args, **kwargs):
|
||||
raise NotFound
|
||||
+48
-40
@@ -2,7 +2,6 @@ import datetime
|
||||
import imaplib
|
||||
import itertools
|
||||
import logging
|
||||
import os
|
||||
import socket
|
||||
import ssl
|
||||
import tempfile
|
||||
@@ -894,6 +893,8 @@ class MailAccountHandler(LoggingMixin):
|
||||
def _handle_message(self, message, rule: MailRule) -> int:
|
||||
message = self._preprocess_message(message)
|
||||
|
||||
processed_elements = 0
|
||||
|
||||
# Skip Message handling when only attachments are to be processed but
|
||||
# message doesn't have any.
|
||||
if (
|
||||
@@ -901,7 +902,7 @@ class MailAccountHandler(LoggingMixin):
|
||||
and rule.consumption_scope == MailRule.ConsumptionScope.ATTACHMENTS_ONLY
|
||||
):
|
||||
self._record_processed_without_consumption(message, rule)
|
||||
return 0
|
||||
return processed_elements
|
||||
|
||||
self.log.debug(
|
||||
f"Rule {rule}: "
|
||||
@@ -912,47 +913,29 @@ class MailAccountHandler(LoggingMixin):
|
||||
tag_ids: list[int] = [tag.id for tag in rule.assign_tags.all()]
|
||||
doc_type = rule.assign_document_type
|
||||
|
||||
consume_tasks: list[Signature] = []
|
||||
|
||||
if (
|
||||
rule.consumption_scope == MailRule.ConsumptionScope.EML_ONLY
|
||||
or rule.consumption_scope == MailRule.ConsumptionScope.EVERYTHING
|
||||
):
|
||||
consume_tasks.append(
|
||||
self._build_eml_task(
|
||||
message,
|
||||
rule,
|
||||
tag_ids,
|
||||
doc_type,
|
||||
),
|
||||
processed_elements += self._process_eml(
|
||||
message,
|
||||
rule,
|
||||
tag_ids,
|
||||
doc_type,
|
||||
)
|
||||
|
||||
if (
|
||||
rule.consumption_scope == MailRule.ConsumptionScope.ATTACHMENTS_ONLY
|
||||
or rule.consumption_scope == MailRule.ConsumptionScope.EVERYTHING
|
||||
):
|
||||
consume_tasks.extend(
|
||||
self._build_attachment_tasks(
|
||||
message,
|
||||
rule,
|
||||
tag_ids,
|
||||
doc_type,
|
||||
),
|
||||
processed_elements += self._process_attachments(
|
||||
message,
|
||||
rule,
|
||||
tag_ids,
|
||||
doc_type,
|
||||
)
|
||||
|
||||
# One chord per message, so the mail action and the ProcessedMail row
|
||||
# are written once, after every part of the message has been consumed
|
||||
if consume_tasks:
|
||||
queue_consumption_tasks(
|
||||
consume_tasks=consume_tasks,
|
||||
rule=rule,
|
||||
message=message,
|
||||
uid_validity=self._current_uid_validity,
|
||||
)
|
||||
else:
|
||||
self._record_processed_without_consumption(message, rule)
|
||||
|
||||
return len(consume_tasks)
|
||||
return processed_elements
|
||||
|
||||
def _record_processed_without_consumption(
|
||||
self,
|
||||
@@ -1011,14 +994,16 @@ class MailAccountHandler(LoggingMixin):
|
||||
return True
|
||||
return False
|
||||
|
||||
def _build_attachment_tasks(
|
||||
def _process_attachments(
|
||||
self,
|
||||
message: MailMessage,
|
||||
rule: MailRule,
|
||||
tag_ids,
|
||||
doc_type,
|
||||
) -> list[Signature]:
|
||||
consume_tasks: list[Signature] = []
|
||||
):
|
||||
processed_attachments = 0
|
||||
|
||||
consume_tasks = []
|
||||
|
||||
for att in message.attachments:
|
||||
if (
|
||||
@@ -1119,6 +1104,8 @@ class MailAccountHandler(LoggingMixin):
|
||||
)
|
||||
|
||||
consume_tasks.append(consume_task)
|
||||
|
||||
processed_attachments += 1
|
||||
else:
|
||||
self.log.debug(
|
||||
f"Rule {rule}: "
|
||||
@@ -1127,22 +1114,33 @@ class MailAccountHandler(LoggingMixin):
|
||||
f"by paperless",
|
||||
)
|
||||
|
||||
return consume_tasks
|
||||
if len(consume_tasks) > 0:
|
||||
queue_consumption_tasks(
|
||||
consume_tasks=consume_tasks,
|
||||
rule=rule,
|
||||
message=message,
|
||||
uid_validity=self._current_uid_validity,
|
||||
)
|
||||
else:
|
||||
# No files to consume, just mark as processed if it wasn't by .eml processing
|
||||
self._record_processed_without_consumption(message, rule)
|
||||
|
||||
def _build_eml_task(
|
||||
return processed_attachments
|
||||
|
||||
def _process_eml(
|
||||
self,
|
||||
message: MailMessage,
|
||||
rule: MailRule,
|
||||
tag_ids,
|
||||
doc_type,
|
||||
) -> Signature:
|
||||
):
|
||||
settings.SCRATCH_DIR.mkdir(parents=True, exist_ok=True)
|
||||
fd, temp_filename = tempfile.mkstemp(
|
||||
_, temp_filename = tempfile.mkstemp(
|
||||
prefix="paperless-mail-",
|
||||
dir=settings.SCRATCH_DIR,
|
||||
suffix=".eml",
|
||||
)
|
||||
with os.fdopen(fd, "wb") as f:
|
||||
with Path(temp_filename).open("wb") as f:
|
||||
# Move "From"-header to beginning of file
|
||||
# TODO: This ugly workaround is needed because the parser is
|
||||
# chosen only by the mime_type detected via magic
|
||||
@@ -1193,7 +1191,17 @@ class MailAccountHandler(LoggingMixin):
|
||||
owner_id=rule.owner.id if rule.owner else None,
|
||||
)
|
||||
|
||||
return consume_file.s(
|
||||
consume_task = consume_file.s(
|
||||
input_doc=input_doc,
|
||||
overrides=doc_overrides,
|
||||
).set(headers={"trigger_source": PaperlessTask.TriggerSource.EMAIL_CONSUME})
|
||||
|
||||
queue_consumption_tasks(
|
||||
consume_tasks=[consume_task],
|
||||
rule=rule,
|
||||
message=message,
|
||||
uid_validity=self._current_uid_validity,
|
||||
)
|
||||
|
||||
processed_elements = 1
|
||||
return processed_elements
|
||||
@@ -416,44 +416,6 @@ class TestMail(
|
||||
1,
|
||||
)
|
||||
|
||||
def test_handle_message_everything_scope_single_row(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A rule consuming the eml and attachments, and a mail with or
|
||||
without attachments
|
||||
WHEN:
|
||||
- The mail is handled and its queued mail action is applied
|
||||
THEN:
|
||||
- The eml and attachments are queued together in one call
|
||||
- Exactly one ProcessedMail row exists and it is not
|
||||
PROCESSED_WO_CONSUMPTION
|
||||
"""
|
||||
rule = MailRule.objects.create(
|
||||
account=MailAccount.objects.create(
|
||||
name="test",
|
||||
imap_server="",
|
||||
username="admin",
|
||||
password="secret",
|
||||
),
|
||||
consumption_scope=MailRule.ConsumptionScope.EVERYTHING,
|
||||
)
|
||||
|
||||
for attachments in (0, 2):
|
||||
with self.subTest(attachments=attachments):
|
||||
self.mailMocker._queue_consumption_tasks_mock.reset_mock()
|
||||
message = self.mailMocker.messageBuilder.create_message(
|
||||
subject=f"{attachments} attachments",
|
||||
attachments=attachments,
|
||||
)
|
||||
|
||||
result = self.mail_account_handler._handle_message(message, rule)
|
||||
self.mailMocker.apply_mail_actions()
|
||||
|
||||
self.assertEqual(result, 1 + attachments)
|
||||
self.mailMocker._queue_consumption_tasks_mock.assert_called_once()
|
||||
processed = ProcessedMail.objects.get(rule=rule, uid=message.uid)
|
||||
self.assertEqual(processed.status, "SUCCESS")
|
||||
|
||||
def test_handle_empty_message_long_subject(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
|
||||
@@ -272,6 +272,8 @@ class TestMailMessageGpgDecryptor(TestMail):
|
||||
"override_title": message.subject,
|
||||
"override_filename": f"{message.subject}.eml",
|
||||
},
|
||||
],
|
||||
[
|
||||
{"override_title": "file_0", "override_filename": "file_0.pdf"},
|
||||
{"override_title": "file_1", "override_filename": "file_1.pdf"},
|
||||
],
|
||||
|
||||
@@ -10,7 +10,6 @@ from django.http import HttpResponseRedirect
|
||||
from django.utils import timezone
|
||||
from django_filters.rest_framework import DjangoFilterBackend
|
||||
from drf_spectacular.types import OpenApiTypes
|
||||
from drf_spectacular.utils import OpenApiParameter
|
||||
from drf_spectacular.utils import extend_schema
|
||||
from drf_spectacular.utils import extend_schema_view
|
||||
from drf_spectacular.utils import inline_serializer
|
||||
@@ -255,39 +254,8 @@ class MailRuleViewSet(PassUserMixin, ModelViewSet[MailRule]):
|
||||
|
||||
@extend_schema_view(
|
||||
get=extend_schema(
|
||||
description=(
|
||||
"Callback view for OAuth2 authentication. Redirects back to the "
|
||||
"frontend, with the outcome in the query string"
|
||||
),
|
||||
parameters=[
|
||||
OpenApiParameter(
|
||||
name="code",
|
||||
# An empty value is rejected
|
||||
type={"type": "string", "minLength": 1},
|
||||
location=OpenApiParameter.QUERY,
|
||||
required=True,
|
||||
description="Authorization code returned by the OAuth provider",
|
||||
),
|
||||
OpenApiParameter(
|
||||
name="state",
|
||||
# An empty value is rejected
|
||||
type={"type": "string", "minLength": 1},
|
||||
location=OpenApiParameter.QUERY,
|
||||
required=True,
|
||||
description="State value, must match the one stored in the session",
|
||||
),
|
||||
OpenApiParameter(
|
||||
name="scope",
|
||||
type=OpenApiTypes.STR,
|
||||
location=OpenApiParameter.QUERY,
|
||||
required=False,
|
||||
description="Granted scopes, sent by Gmail but not by Outlook",
|
||||
),
|
||||
],
|
||||
responses={
|
||||
302: None,
|
||||
(400, "text/html"): OpenApiTypes.STR,
|
||||
},
|
||||
description="Callback view for OAuth2 authentication",
|
||||
responses={200: None},
|
||||
),
|
||||
)
|
||||
class OauthCallbackView(GenericAPIView[Any]):
|
||||
|
||||
Reference in new issue
Block a user