mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-30 16:45:22 +00:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
416161dd1e | ||
|
|
afa722ba95 | ||
|
|
b1d06e1b18 | ||
|
|
641bb83860 | ||
|
|
d35c6e6e97 | ||
|
|
8b80913d3d | ||
|
|
51822d6273 | ||
|
|
1dc797e9be | ||
|
|
0cb56c49bb | ||
|
|
5cea561838 | ||
|
|
ca32553478 | ||
|
|
cfbb383514 | ||
|
|
9a2a50d23f | ||
|
|
d4617d8177 | ||
|
|
155a118f0d | ||
|
|
bc9d45cecc | ||
|
|
1655a844e3 |
No files matched your search
+85
-182
@@ -17,6 +17,7 @@ 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]
|
||||
@@ -38,13 +39,10 @@ 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]
|
||||
@@ -89,7 +87,6 @@ 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]
|
||||
@@ -115,7 +112,6 @@ 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]
|
||||
@@ -137,12 +133,19 @@ 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]
|
||||
@@ -191,8 +194,6 @@ 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]
|
||||
@@ -202,7 +203,6 @@ 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,6 +232,7 @@ 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]
|
||||
@@ -285,6 +286,8 @@ 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]
|
||||
@@ -337,12 +340,21 @@ 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]
|
||||
@@ -354,14 +366,21 @@ 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: Incompatible return value type (got "QuerySet[Model, ModelT]", expected "QuerySet[ModelT, ModelT]") [return-value]
|
||||
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: 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]
|
||||
@@ -377,7 +396,6 @@ 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]
|
||||
@@ -390,6 +408,7 @@ 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]
|
||||
@@ -399,12 +418,8 @@ 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 | SupportsTrunc" [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 "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]
|
||||
@@ -414,6 +429,11 @@ 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]
|
||||
@@ -482,7 +502,6 @@ src/documents/serialisers.py:0: error: Function is missing a type annotation [n
|
||||
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 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]
|
||||
@@ -534,6 +553,8 @@ 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]
|
||||
@@ -541,10 +562,15 @@ 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]
|
||||
@@ -603,7 +629,6 @@ 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]
|
||||
@@ -648,11 +673,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]
|
||||
@@ -691,7 +716,6 @@ 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]
|
||||
@@ -766,8 +790,6 @@ 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]
|
||||
@@ -823,12 +845,6 @@ 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]
|
||||
@@ -837,13 +853,6 @@ 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]
|
||||
@@ -879,7 +888,6 @@ 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]
|
||||
@@ -892,13 +900,6 @@ 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]
|
||||
@@ -926,9 +927,6 @@ 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]
|
||||
@@ -956,7 +954,6 @@ 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]
|
||||
@@ -991,14 +988,7 @@ 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]
|
||||
@@ -1024,8 +1014,7 @@ 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: 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 [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]
|
||||
@@ -1071,34 +1060,6 @@ 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]
|
||||
@@ -1196,7 +1157,6 @@ 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]
|
||||
@@ -1289,8 +1249,6 @@ 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]
|
||||
@@ -1315,14 +1273,11 @@ 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]
|
||||
@@ -1376,12 +1331,10 @@ 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_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_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_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]
|
||||
@@ -1391,7 +1344,6 @@ 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]
|
||||
@@ -1407,8 +1359,6 @@ 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]
|
||||
@@ -1490,10 +1440,6 @@ 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]
|
||||
@@ -1548,8 +1494,6 @@ 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]
|
||||
@@ -1566,15 +1510,6 @@ 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]
|
||||
@@ -1588,28 +1523,27 @@ 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 | 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 "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 "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]
|
||||
@@ -1635,10 +1569,6 @@ 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]
|
||||
@@ -1712,6 +1642,7 @@ src/documents/views.py:0: error: Function is missing a type annotation for one o
|
||||
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]
|
||||
src/documents/views.py:0: error: Incompatible types in assignment (expression has type "Any | None", variable has type "dict[Any, Any]") [assignment]
|
||||
src/documents/views.py:0: error: Incompatible types in assignment (expression has type "ClassificationSuggestions", variable has type "dict[Any, Any]") [assignment]
|
||||
src/documents/views.py:0: error: Incompatible types in assignment (expression has type "QuerySet[Document, Document]", variable has type "list[Any]") [assignment]
|
||||
@@ -1738,8 +1669,9 @@ 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 "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]
|
||||
src/documents/views.py:0: error: Missing type arguments for generic type "list" [type-arg]
|
||||
@@ -1754,18 +1686,17 @@ 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[Correspondent]" 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[Any]" 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]
|
||||
@@ -1785,8 +1716,6 @@ 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]
|
||||
@@ -1808,7 +1737,6 @@ 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]
|
||||
@@ -1841,6 +1769,7 @@ 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]
|
||||
@@ -1863,12 +1792,10 @@ 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]
|
||||
@@ -1924,17 +1851,12 @@ 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]
|
||||
@@ -1956,7 +1878,6 @@ 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]
|
||||
@@ -1966,6 +1887,7 @@ 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]
|
||||
@@ -1976,6 +1898,7 @@ 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]
|
||||
@@ -1983,7 +1906,6 @@ 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]
|
||||
@@ -2003,6 +1925,8 @@ 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]
|
||||
@@ -2063,21 +1987,14 @@ 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/test_adapter.py:0: error: "BaseDatabaseWrapper" has no attribute "is_in_memory_db" [attr-defined]
|
||||
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: 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]
|
||||
@@ -2088,10 +2005,6 @@ 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]
|
||||
@@ -2101,7 +2014,6 @@ 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]
|
||||
@@ -2181,7 +2093,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 | SupportsTrunc" [arg-type]
|
||||
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: 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]
|
||||
@@ -2231,20 +2143,16 @@ 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 ("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/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/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 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: 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: 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]
|
||||
@@ -2267,7 +2175,6 @@ 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]
|
||||
@@ -2297,8 +2204,6 @@ 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]
|
||||
@@ -2314,7 +2219,6 @@ 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]
|
||||
@@ -2327,9 +2231,6 @@ 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]
|
||||
@@ -2363,8 +2264,6 @@ 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]
|
||||
@@ -2414,9 +2313,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 | 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: 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: 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]
|
||||
@@ -2481,6 +2380,8 @@ 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]
|
||||
@@ -2498,6 +2399,8 @@ 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]
|
||||
|
||||
+401
-1010
File diff suppressed because it is too large.
Load diff
@@ -23,6 +23,7 @@ dependencies = [
|
||||
"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.
|
||||
@@ -46,6 +47,7 @@ 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.16",
|
||||
"jinja2~=3.1.6",
|
||||
@@ -56,10 +58,13 @@ 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",
|
||||
|
||||
+11
-73
@@ -1,7 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
import hmac
|
||||
import logging
|
||||
import pickle
|
||||
import re
|
||||
@@ -15,9 +14,6 @@ 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
|
||||
@@ -37,9 +33,11 @@ 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")
|
||||
|
||||
@@ -77,49 +75,6 @@ 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:
|
||||
"""
|
||||
@@ -209,8 +164,6 @@ 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
|
||||
@@ -230,10 +183,6 @@ 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:
|
||||
"""
|
||||
@@ -248,30 +197,19 @@ 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()
|
||||
|
||||
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
|
||||
# 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
|
||||
|
||||
# Catch warnings for processing
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
@@ -315,7 +253,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, self._new_hmac()) as f:
|
||||
with SignedFileWriter(settings.MODEL_FILE) as f:
|
||||
pickle.dump(
|
||||
(
|
||||
self.FORMAT_VERSION,
|
||||
|
||||
+177
-24
@@ -6,13 +6,17 @@ import json
|
||||
import logging
|
||||
import operator
|
||||
from contextlib import contextmanager
|
||||
from datetime import UTC
|
||||
from datetime import timedelta
|
||||
from decimal import Decimal
|
||||
from decimal import InvalidOperation
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import Any
|
||||
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import models
|
||||
from django.db.models import Case
|
||||
from django.db.models import CharField
|
||||
from django.db.models import Count
|
||||
@@ -29,6 +33,7 @@ from django.db.models.functions import NullIf
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django_filters import DateFilter
|
||||
from django_filters.filterset import FILTER_FOR_DBFIELD_DEFAULTS
|
||||
from django_filters.rest_framework import BooleanFilter
|
||||
from django_filters.rest_framework import CharFilter
|
||||
from django_filters.rest_framework import DateTimeFilter
|
||||
@@ -61,6 +66,7 @@ from documents.versioning import annotate_effective_content
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Callable
|
||||
from collections.abc import Iterable
|
||||
from datetime import datetime
|
||||
|
||||
CHAR_KWARGS = ["istartswith", "iendswith", "icontains", "iexact"]
|
||||
@@ -95,7 +101,115 @@ CUSTOM_FIELD_QUERY_MAX_ATOMS = 20
|
||||
logger = logging.getLogger("paperless.api")
|
||||
|
||||
|
||||
class CorrespondentFilterSet(FilterSet):
|
||||
# The smallest and largest values a 64 bit integer column can hold. Nothing outside can
|
||||
# match a row, and handing it to the database raises an error on some backends.
|
||||
INT64_MIN = -(2**63)
|
||||
INT64_MAX = 2**63 - 1
|
||||
# SmallIntegerField and IntegerField columns, the same size on every supported database
|
||||
INT16_MIN = -(2**15)
|
||||
INT16_MAX = 2**15 - 1
|
||||
INT32_MIN = -(2**31)
|
||||
INT32_MAX = 2**31 - 1
|
||||
# Real UTC offsets run from -12:00 to +14:00, databases reject anything much larger.
|
||||
MAX_UTC_OFFSET = timedelta(hours=14)
|
||||
DATE_PART_BOUNDS = {"year": (1, 9999), "month": (1, 12), "day": (1, 31)}
|
||||
|
||||
|
||||
def in_id_range(value: int) -> bool:
|
||||
return INT64_MIN <= value <= INT64_MAX
|
||||
|
||||
|
||||
def in_range_ids(ids: Iterable[int]) -> list[int]:
|
||||
"""
|
||||
The ids a row could have. Any other id cannot match, and some databases raise an
|
||||
error instead of finding nothing when asked for one.
|
||||
"""
|
||||
return [i for i in ids if in_id_range(i)]
|
||||
|
||||
|
||||
class BoundedDecimalField(forms.DecimalField):
|
||||
"""
|
||||
django-filter only bounds numbers at 1e50, which is far past any integer column
|
||||
"""
|
||||
|
||||
def __init__(self, **kwargs: Any) -> None:
|
||||
kwargs.setdefault("min_value", INT64_MIN)
|
||||
kwargs.setdefault("max_value", INT64_MAX)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
class BoundedNumberFilter(NumberFilter):
|
||||
field_class = BoundedDecimalField
|
||||
|
||||
|
||||
class BoundedIntegerField(forms.IntegerField):
|
||||
def __init__(self, **kwargs: Any) -> None:
|
||||
kwargs.setdefault("min_value", INT64_MIN)
|
||||
kwargs.setdefault("max_value", INT64_MAX)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
class BoundedDateTimeField(forms.DateTimeField):
|
||||
def clean(self, value: Any) -> Any:
|
||||
value = super().clean(value)
|
||||
if value is not None and timezone.is_aware(value):
|
||||
offset = value.utcoffset()
|
||||
if offset is not None and abs(offset) > MAX_UTC_OFFSET:
|
||||
raise forms.ValidationError(
|
||||
_("Enter a valid UTC offset."),
|
||||
code="invalid",
|
||||
)
|
||||
try:
|
||||
value.astimezone(UTC)
|
||||
except OverflowError:
|
||||
raise forms.ValidationError(
|
||||
_("Enter a valid date and time."),
|
||||
code="invalid",
|
||||
)
|
||||
return value
|
||||
|
||||
|
||||
class BoundedDateTimeFilter(DateTimeFilter):
|
||||
field_class = BoundedDateTimeField
|
||||
|
||||
|
||||
class BoundedFilterSet(FilterSet):
|
||||
"""
|
||||
A FilterSet whose generated number and datetime filters reject values the database
|
||||
cannot hold, as a 400, instead of failing later as a server error
|
||||
"""
|
||||
|
||||
FILTER_DEFAULTS = {
|
||||
**FILTER_FOR_DBFIELD_DEFAULTS,
|
||||
**{
|
||||
field: {"filter_class": BoundedNumberFilter}
|
||||
for field in (
|
||||
models.AutoField,
|
||||
models.BigAutoField,
|
||||
models.SmallAutoField,
|
||||
models.IntegerField,
|
||||
models.BigIntegerField,
|
||||
models.SmallIntegerField,
|
||||
models.PositiveIntegerField,
|
||||
models.PositiveSmallIntegerField,
|
||||
models.PositiveBigIntegerField,
|
||||
)
|
||||
},
|
||||
models.DateTimeField: {"filter_class": BoundedDateTimeFilter},
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def filter_for_field(cls, field, field_name, lookup_expr=None):
|
||||
filter_ = super().filter_for_field(field, field_name, lookup_expr)
|
||||
# The lookup resolves to a plain integer field, so only here is it known to be
|
||||
# a year, month or day
|
||||
bounds = DATE_PART_BOUNDS.get(lookup_expr)
|
||||
if bounds is not None and isinstance(filter_, NumberFilter):
|
||||
filter_.extra["min_value"], filter_.extra["max_value"] = bounds
|
||||
return filter_
|
||||
|
||||
|
||||
class CorrespondentFilterSet(BoundedFilterSet):
|
||||
class Meta:
|
||||
model = Correspondent
|
||||
fields = {
|
||||
@@ -104,7 +218,7 @@ class CorrespondentFilterSet(FilterSet):
|
||||
}
|
||||
|
||||
|
||||
class TagFilterSet(FilterSet):
|
||||
class TagFilterSet(BoundedFilterSet):
|
||||
class Meta:
|
||||
model = Tag
|
||||
fields = {
|
||||
@@ -119,7 +233,7 @@ class TagFilterSet(FilterSet):
|
||||
)
|
||||
|
||||
|
||||
class DocumentTypeFilterSet(FilterSet):
|
||||
class DocumentTypeFilterSet(BoundedFilterSet):
|
||||
class Meta:
|
||||
model = DocumentType
|
||||
fields = {
|
||||
@@ -128,7 +242,7 @@ class DocumentTypeFilterSet(FilterSet):
|
||||
}
|
||||
|
||||
|
||||
class StoragePathFilterSet(FilterSet):
|
||||
class StoragePathFilterSet(BoundedFilterSet):
|
||||
class Meta:
|
||||
model = StoragePath
|
||||
fields = {
|
||||
@@ -155,9 +269,21 @@ class ObjectFilter(Filter):
|
||||
return qs
|
||||
|
||||
if self.in_list:
|
||||
qs = qs.filter(**{f"{self.field_name}__id__in": object_ids}).distinct()
|
||||
qs = qs.filter(
|
||||
**{
|
||||
f"{self.field_name}__id__in": [
|
||||
obj_id for obj_id in object_ids if in_id_range(obj_id)
|
||||
],
|
||||
},
|
||||
).distinct()
|
||||
else:
|
||||
for obj_id in object_ids:
|
||||
if not in_id_range(obj_id):
|
||||
# No row has this id: excluding it changes nothing, requiring it
|
||||
# matches nothing
|
||||
if self.exclude:
|
||||
continue
|
||||
return qs.none()
|
||||
if self.exclude:
|
||||
qs = qs.exclude(**{f"{self.field_name}__id": obj_id})
|
||||
else:
|
||||
@@ -206,8 +332,14 @@ class EffectiveContentFilter(Filter):
|
||||
)
|
||||
|
||||
|
||||
@extend_schema_field(serializers.BooleanField)
|
||||
@extend_schema_field(serializers.IntegerField)
|
||||
class SharedByUser(Filter):
|
||||
"""
|
||||
Documents owned by the given user id that are shared with someone
|
||||
"""
|
||||
|
||||
field_class = BoundedIntegerField
|
||||
|
||||
def filter(self, qs, value):
|
||||
ctype = ContentType.objects.get_for_model(self.model)
|
||||
UserObjectPermission = get_user_obj_perms_model()
|
||||
@@ -242,7 +374,7 @@ class SharedByUser(Filter):
|
||||
)
|
||||
|
||||
|
||||
class CustomFieldFilterSet(FilterSet):
|
||||
class CustomFieldFilterSet(BoundedFilterSet):
|
||||
class Meta:
|
||||
model = CustomField
|
||||
fields = {
|
||||
@@ -251,8 +383,8 @@ class CustomFieldFilterSet(FilterSet):
|
||||
}
|
||||
|
||||
|
||||
class WorkflowFilterSet(FilterSet):
|
||||
trigger_type = NumberFilter(field_name="triggers__type", distinct=True)
|
||||
class WorkflowFilterSet(BoundedFilterSet):
|
||||
trigger_type = BoundedNumberFilter(field_name="triggers__type", distinct=True)
|
||||
|
||||
class Meta:
|
||||
model = Workflow
|
||||
@@ -276,9 +408,25 @@ class CustomFieldsFilter(Filter):
|
||||
option_ids = []
|
||||
if fields_with_matching_selects.count() > 0:
|
||||
for field in fields_with_matching_selects:
|
||||
options = field.extra_data.get("select_options", [])
|
||||
for _, option in enumerate(options):
|
||||
if option.get("label").lower().find(value.lower()) != -1:
|
||||
# Extra data saved by older versions may not be an object
|
||||
options = (
|
||||
field.extra_data.get("select_options")
|
||||
if isinstance(field.extra_data, dict)
|
||||
else None
|
||||
)
|
||||
if not isinstance(options, list):
|
||||
options = []
|
||||
for option in options:
|
||||
label = (
|
||||
option.get("label") if isinstance(option, dict) else None
|
||||
)
|
||||
if (
|
||||
isinstance(label, str)
|
||||
and label.lower().find(
|
||||
value.lower(),
|
||||
)
|
||||
!= -1
|
||||
):
|
||||
option_ids.extend([option.get("id")])
|
||||
# A document with multiple custom field instances can match more
|
||||
# than one of these OR-ed branches (or the same branch via
|
||||
@@ -852,7 +1000,7 @@ class CustomFieldQueryFilter(Filter):
|
||||
return qs.filter(pk__in=matching_ids)
|
||||
|
||||
|
||||
class DocumentFilterSet(FilterSet):
|
||||
class DocumentFilterSet(BoundedFilterSet):
|
||||
has_duplicates = BooleanFilter(method="filter_has_duplicates")
|
||||
|
||||
def __init__(self, *args: Any, user: Any = None, **kwargs: Any) -> None:
|
||||
@@ -984,7 +1132,7 @@ class DocumentFilterSet(FilterSet):
|
||||
}
|
||||
|
||||
|
||||
class ShareLinkFilterSet(FilterSet):
|
||||
class ShareLinkFilterSet(BoundedFilterSet):
|
||||
class Meta:
|
||||
model = ShareLink
|
||||
fields = {
|
||||
@@ -993,7 +1141,7 @@ class ShareLinkFilterSet(FilterSet):
|
||||
}
|
||||
|
||||
|
||||
class ShareLinkBundleFilterSet(FilterSet):
|
||||
class ShareLinkBundleFilterSet(BoundedFilterSet):
|
||||
documents = Filter(method="filter_documents")
|
||||
|
||||
class Meta:
|
||||
@@ -1013,10 +1161,13 @@ class ShareLinkBundleFilterSet(FilterSet):
|
||||
return queryset.none()
|
||||
if not ids:
|
||||
return queryset
|
||||
ids = [item for item in ids if in_id_range(item)]
|
||||
if not ids:
|
||||
return queryset.none()
|
||||
return queryset.filter(documents__in=ids).distinct()
|
||||
|
||||
|
||||
class PaperlessTaskFilterSet(FilterSet):
|
||||
class PaperlessTaskFilterSet(BoundedFilterSet):
|
||||
name = CharFilter(
|
||||
method="filter_name",
|
||||
label="Name",
|
||||
@@ -1052,13 +1203,13 @@ class PaperlessTaskFilterSet(FilterSet):
|
||||
field_name="acknowledged",
|
||||
)
|
||||
|
||||
date_created_after = DateTimeFilter(
|
||||
date_created_after = BoundedDateTimeFilter(
|
||||
field_name="date_created",
|
||||
lookup_expr="gte",
|
||||
label="Created After",
|
||||
)
|
||||
|
||||
date_created_before = DateTimeFilter(
|
||||
date_created_before = BoundedDateTimeFilter(
|
||||
field_name="date_created",
|
||||
lookup_expr="lte",
|
||||
label="Created Before",
|
||||
@@ -1110,9 +1261,10 @@ class PaperlessTaskFilterSet(FilterSet):
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
else:
|
||||
query |= Q(result_data__document_id=numeric_value) | Q(
|
||||
result_data__duplicate_of=numeric_value,
|
||||
)
|
||||
if in_id_range(numeric_value):
|
||||
query |= Q(result_data__document_id=numeric_value) | Q(
|
||||
result_data__duplicate_of=numeric_value,
|
||||
)
|
||||
|
||||
if "duplicate" in value.lower():
|
||||
query |= Q(result_data__duplicate_of__isnull=False)
|
||||
@@ -1184,12 +1336,13 @@ class DocumentsOrderingFilter(OrderingFilter):
|
||||
def filter_queryset(self, request, queryset, view):
|
||||
param = request.query_params.get("ordering")
|
||||
if param and self.prefix in param:
|
||||
custom_field_id = int(param.split(self.prefix)[1])
|
||||
custom_field_suffix = param.split(self.prefix)[1]
|
||||
try:
|
||||
custom_field_id = int(custom_field_suffix)
|
||||
field = CustomField.objects.get(pk=custom_field_id)
|
||||
except CustomField.DoesNotExist:
|
||||
except (ValueError, CustomField.DoesNotExist):
|
||||
raise serializers.ValidationError(
|
||||
{self.prefix + str(custom_field_id): [_("Custom field not found")]},
|
||||
{self.prefix + custom_field_suffix: [_("Custom field not found")]},
|
||||
)
|
||||
|
||||
annotation = None
|
||||
|
||||
@@ -74,6 +74,10 @@ _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.
|
||||
@@ -998,7 +1002,8 @@ class TantivyBackend:
|
||||
|
||||
Args:
|
||||
term: Prefix to match against autocomplete words
|
||||
limit: Maximum number of suggestions to return
|
||||
limit: Maximum number of suggestions to return, capped at
|
||||
MAX_AUTOCOMPLETE_LIMIT
|
||||
user: User for permission filtering (None for no filtering)
|
||||
|
||||
Returns:
|
||||
@@ -1021,7 +1026,7 @@ class TantivyBackend:
|
||||
"autocomplete_word",
|
||||
normalized_term,
|
||||
permission_query,
|
||||
limit,
|
||||
min(limit, MAX_AUTOCOMPLETE_LIMIT),
|
||||
)
|
||||
|
||||
return [x[0] for x in matches]
|
||||
|
||||
+179
-44
@@ -52,7 +52,10 @@ if settings.AUDIT_LOG_ENABLED:
|
||||
|
||||
from documents import bulk_edit
|
||||
from documents.data_models import DocumentSource
|
||||
from documents.filters import INT32_MAX
|
||||
from documents.filters import INT32_MIN
|
||||
from documents.filters import CustomFieldQueryParser
|
||||
from documents.filters import in_range_ids
|
||||
from documents.models import Correspondent
|
||||
from documents.models import CustomField
|
||||
from documents.models import CustomFieldInstance
|
||||
@@ -112,6 +115,10 @@ 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]):
|
||||
@@ -226,7 +233,7 @@ class SetPermissionsMixin:
|
||||
def _validate_user_ids(self, user_ids):
|
||||
users = User.objects.none()
|
||||
if user_ids is not None:
|
||||
users = User.objects.filter(id__in=user_ids)
|
||||
users = User.objects.filter(id__in=in_range_ids(user_ids))
|
||||
if not users.count() == len(user_ids):
|
||||
raise serializers.ValidationError(
|
||||
"Some users in don't exist or were specified twice.",
|
||||
@@ -236,7 +243,7 @@ class SetPermissionsMixin:
|
||||
def _validate_group_ids(self, group_ids):
|
||||
groups = Group.objects.none()
|
||||
if group_ids is not None:
|
||||
groups = Group.objects.filter(id__in=group_ids)
|
||||
groups = Group.objects.filter(id__in=in_range_ids(group_ids))
|
||||
if not groups.count() == len(group_ids):
|
||||
raise serializers.ValidationError(
|
||||
"Some groups in don't exist or were specified twice.",
|
||||
@@ -444,6 +451,10 @@ class OwnedObjectSerializer(
|
||||
|
||||
def validate_unique_together(self, validated_data, instance=None) -> None:
|
||||
# workaround for https://github.com/encode/django-rest-framework/issues/9358
|
||||
# An update that does not mention the owner keeps the current one, which
|
||||
# still has to be unique with the new name
|
||||
if instance is not None and "owner" not in validated_data:
|
||||
validated_data = {**validated_data, "owner": instance.owner}
|
||||
if "owner" in validated_data and "name" in self.Meta.fields:
|
||||
name = validated_data.get("name", instance.name if instance else None)
|
||||
objects = (
|
||||
@@ -721,6 +732,15 @@ class CustomFieldSerializer(serializers.ModelSerializer[CustomField]):
|
||||
]
|
||||
|
||||
def validate(self, attrs):
|
||||
# Extra data is read as an object everywhere, any other JSON would be stored
|
||||
# to fail on the next read
|
||||
if attrs.get("extra_data") is not None and not isinstance(
|
||||
attrs["extra_data"],
|
||||
dict,
|
||||
):
|
||||
raise serializers.ValidationError(
|
||||
{"extra_data": "Must be an object"},
|
||||
)
|
||||
# TODO: remove pending https://github.com/encode/django-rest-framework/issues/7173
|
||||
name = attrs.get(
|
||||
"name",
|
||||
@@ -746,14 +766,19 @@ class CustomFieldSerializer(serializers.ModelSerializer[CustomField]):
|
||||
self.instance
|
||||
and self.instance.data_type == CustomField.FieldDataType.SELECT
|
||||
):
|
||||
select_options = (
|
||||
attrs["extra_data"].get("select_options")
|
||||
if isinstance(attrs.get("extra_data"), dict)
|
||||
else None
|
||||
)
|
||||
if (
|
||||
"extra_data" not in attrs
|
||||
or "select_options" not in attrs["extra_data"]
|
||||
or not isinstance(attrs["extra_data"]["select_options"], list)
|
||||
or len(attrs["extra_data"]["select_options"]) == 0
|
||||
not isinstance(select_options, list)
|
||||
or len(select_options) == 0
|
||||
or not all(
|
||||
len(option.get("label", "")) > 0
|
||||
for option in attrs["extra_data"]["select_options"]
|
||||
isinstance(option, dict)
|
||||
and isinstance(option.get("label", ""), str)
|
||||
and len(option.get("label", "")) > 0
|
||||
for option in select_options
|
||||
)
|
||||
):
|
||||
raise serializers.ValidationError(
|
||||
@@ -766,7 +791,7 @@ class CustomFieldSerializer(serializers.ModelSerializer[CustomField]):
|
||||
elif (
|
||||
"data_type" in attrs
|
||||
and attrs["data_type"] == CustomField.FieldDataType.MONETARY
|
||||
and "extra_data" in attrs
|
||||
and isinstance(attrs.get("extra_data"), dict)
|
||||
and "default_currency" in attrs["extra_data"]
|
||||
and attrs["extra_data"]["default_currency"] is not None
|
||||
and (
|
||||
@@ -798,7 +823,7 @@ class ReadWriteSerializerMethodField(serializers.SerializerMethodField):
|
||||
|
||||
|
||||
def validate_documentlink_targets(user, doc_ids):
|
||||
if Document.objects.filter(id__in=doc_ids).count() != len(doc_ids):
|
||||
if Document.objects.filter(id__in=in_range_ids(doc_ids)).count() != len(doc_ids):
|
||||
raise serializers.ValidationError(
|
||||
"Some documents in value don't exist or were specified twice.",
|
||||
)
|
||||
@@ -1465,12 +1490,29 @@ class SavedViewSerializer(OwnedObjectSerializer):
|
||||
|
||||
def validate(self, attrs):
|
||||
attrs = super().validate(attrs)
|
||||
# On a PATCH the nested rules are validated as partial, but a stored rule
|
||||
# always needs its type
|
||||
for rule in attrs.get("filter_rules") or []:
|
||||
if "rule_type" not in rule:
|
||||
raise serializers.ValidationError(
|
||||
{"filter_rules": "Every rule needs a rule_type"},
|
||||
)
|
||||
if "display_fields" in attrs and attrs["display_fields"] is not None:
|
||||
if not isinstance(attrs["display_fields"], list):
|
||||
raise serializers.ValidationError(
|
||||
{"display_fields": "Must be a list"},
|
||||
)
|
||||
for field in attrs["display_fields"]:
|
||||
if (
|
||||
SavedView.DisplayFields.CUSTOM_FIELD[:-2] in field
|
||||
): # i.e. check for 'custom_field_' prefix
|
||||
field_id = int(re.search(r"\d+", field)[0])
|
||||
if not isinstance(field, str):
|
||||
raise serializers.ValidationError(
|
||||
f"Invalid field: {field}",
|
||||
)
|
||||
custom_field = re.fullmatch(
|
||||
rf"{re.escape(SavedView.DisplayFields.CUSTOM_FIELD[:-2])}(\d+)",
|
||||
field,
|
||||
) # i.e. 'custom_field_' followed by an id
|
||||
if custom_field:
|
||||
field_id = int(custom_field[1])
|
||||
if not CustomField.objects.filter(id=field_id).exists():
|
||||
raise serializers.ValidationError(
|
||||
f"Invalid field: {field}",
|
||||
@@ -1549,7 +1591,9 @@ class DocumentListSerializer(serializers.Serializer[dict[str, list[int]]]):
|
||||
raise serializers.ValidationError(f"{name} must be a list")
|
||||
if not all(isinstance(i, int) for i in documents):
|
||||
raise serializers.ValidationError(f"{name} must be a list of integers")
|
||||
count = Document.objects.filter(id__in=documents).count()
|
||||
# An id beyond what a database column holds can't exist, and some backends raise
|
||||
# an error instead of finding nothing
|
||||
count = Document.objects.filter(id__in=in_range_ids(documents)).count()
|
||||
if not count == len(documents):
|
||||
raise serializers.ValidationError(
|
||||
f"Some documents in {name} don't exist or were specified twice.",
|
||||
@@ -1722,6 +1766,10 @@ class EditPdfDocumentsSerializer(DocumentListSerializer, SourceModeValidationMix
|
||||
raise serializers.ValidationError(
|
||||
"Edit PDF method only supports one document",
|
||||
)
|
||||
if len(documents) == 0:
|
||||
raise serializers.ValidationError(
|
||||
"Edit PDF method requires a document",
|
||||
)
|
||||
|
||||
operations = attrs["operations"]
|
||||
|
||||
@@ -1873,7 +1921,7 @@ class BulkEditSerializer(
|
||||
raise serializers.ValidationError(f"{name} must be a list")
|
||||
if not all(isinstance(i, int) for i in tags):
|
||||
raise serializers.ValidationError(f"{name} must be a list of integers")
|
||||
count = Tag.objects.filter(id__in=tags).count()
|
||||
count = Tag.objects.filter(id__in=in_range_ids(tags)).count()
|
||||
if not count == len(tags):
|
||||
raise serializers.ValidationError(
|
||||
f"Some tags in {name} don't exist or were specified twice.",
|
||||
@@ -1899,7 +1947,7 @@ class BulkEditSerializer(
|
||||
raise serializers.ValidationError(
|
||||
f"{name} must be a list of integers or a dict of id:value pairs",
|
||||
)
|
||||
count = CustomField.objects.filter(id__in=ids).count()
|
||||
count = CustomField.objects.filter(id__in=in_range_ids(ids)).count()
|
||||
if not count == len(ids):
|
||||
raise serializers.ValidationError(
|
||||
f"Some custom fields in {name} don't exist or were specified twice.",
|
||||
@@ -2265,12 +2313,20 @@ class BulkEditSerializer(
|
||||
raise serializers.ValidationError(
|
||||
"Split method only supports one document",
|
||||
)
|
||||
if len(attrs["documents"]) == 0:
|
||||
raise serializers.ValidationError(
|
||||
"Split method requires a document",
|
||||
)
|
||||
self._validate_parameters_split(parameters, attrs["documents"][0])
|
||||
elif method == bulk_edit.delete_pages:
|
||||
if len(attrs["documents"]) > 1:
|
||||
raise serializers.ValidationError(
|
||||
"Delete pages method only supports one document",
|
||||
)
|
||||
if len(attrs["documents"]) == 0:
|
||||
raise serializers.ValidationError(
|
||||
"Delete pages method requires a document",
|
||||
)
|
||||
self._validate_parameters_delete_pages(parameters)
|
||||
elif method == bulk_edit.merge:
|
||||
self._validate_parameters_merge(parameters)
|
||||
@@ -2279,6 +2335,10 @@ class BulkEditSerializer(
|
||||
raise serializers.ValidationError(
|
||||
"Edit PDF method only supports one document",
|
||||
)
|
||||
if len(attrs["documents"]) == 0:
|
||||
raise serializers.ValidationError(
|
||||
"Edit PDF method requires a document",
|
||||
)
|
||||
self._validate_parameters_edit_pdf(parameters, attrs["documents"][0])
|
||||
elif method == bulk_edit.remove_password:
|
||||
self.validate_parameters_remove_password(parameters)
|
||||
@@ -2363,8 +2423,9 @@ class PostDocumentSerializer(serializers.Serializer[dict[str, Any]]):
|
||||
)
|
||||
|
||||
def validate_document(self, document):
|
||||
document_data = document.file.read()
|
||||
mime_type = magic.from_buffer(document_data, mime=True)
|
||||
# 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)
|
||||
|
||||
if not is_mime_type_supported(mime_type):
|
||||
if (
|
||||
@@ -2380,7 +2441,7 @@ class PostDocumentSerializer(serializers.Serializer[dict[str, Any]]):
|
||||
_("File type %(type)s not supported") % {"type": mime_type},
|
||||
)
|
||||
|
||||
return document.name, document_data
|
||||
return document.name, document
|
||||
|
||||
def validate_correspondent(self, correspondent):
|
||||
if correspondent:
|
||||
@@ -2448,7 +2509,9 @@ class PostDocumentSerializer(serializers.Serializer[dict[str, Any]]):
|
||||
"Custom fields must be a list of integers or an object mapping ids to values.",
|
||||
),
|
||||
)
|
||||
if CustomField.objects.filter(id__in=ids).count() != len(set(ids)):
|
||||
if CustomField.objects.filter(id__in=in_range_ids(ids)).count() != len(
|
||||
set(ids),
|
||||
):
|
||||
raise serializers.ValidationError(
|
||||
_("Some custom fields don't exist or were specified twice."),
|
||||
)
|
||||
@@ -2628,12 +2691,17 @@ class UiSettingsViewSerializer(serializers.ModelSerializer[UiSettings]):
|
||||
]
|
||||
|
||||
def validate_settings(self, settings):
|
||||
if settings is None:
|
||||
return settings
|
||||
if not isinstance(settings, dict):
|
||||
raise serializers.ValidationError("Settings must be an object")
|
||||
# we never save update checking backend setting
|
||||
if "update_checking" in settings:
|
||||
try:
|
||||
settings["update_checking"].pop("backend_setting")
|
||||
except KeyError:
|
||||
pass
|
||||
if not isinstance(settings["update_checking"], dict):
|
||||
raise serializers.ValidationError(
|
||||
{"update_checking": "Must be an object"},
|
||||
)
|
||||
settings["update_checking"].pop("backend_setting", None)
|
||||
return settings
|
||||
|
||||
def create(self, validated_data):
|
||||
@@ -2850,7 +2918,7 @@ class AcknowledgeTasksViewSerializer(serializers.Serializer[dict[str, Any]]):
|
||||
if not all(isinstance(i, int) for i in tasks):
|
||||
raise serializers.ValidationError(f"{name} must be a list of integers")
|
||||
queryset = self.context.get("queryset", PaperlessTask.objects.all())
|
||||
count = queryset.filter(id__in=tasks).count()
|
||||
count = queryset.filter(id__in=in_range_ids(tasks)).count()
|
||||
if not count == len(tasks):
|
||||
raise serializers.ValidationError(
|
||||
f"Some tasks in {name} don't exist or were specified twice.",
|
||||
@@ -2893,6 +2961,8 @@ class ShareLinkSerializer(OwnedObjectSerializer):
|
||||
"document_title",
|
||||
"file_version",
|
||||
)
|
||||
# The model field is blank=True but not nullable, so it would be optional
|
||||
extra_kwargs = {"document": {"required": True}}
|
||||
|
||||
def create(self, validated_data):
|
||||
validated_data["slug"] = get_random_string(50)
|
||||
@@ -2984,7 +3054,7 @@ class ShareLinkBundleSerializer(OwnedObjectSerializer):
|
||||
share_link_bundle = super().create(validated_data)
|
||||
|
||||
documents = list(
|
||||
Document.objects.filter(pk__in=document_ids).only(
|
||||
Document.objects.filter(pk__in=in_range_ids(document_ids)).only(
|
||||
"pk",
|
||||
),
|
||||
)
|
||||
@@ -3090,7 +3160,7 @@ class BulkEditObjectsSerializer(SerializerWithPerms, SetPermissionsMixin):
|
||||
if not all(isinstance(i, int) for i in objects):
|
||||
raise serializers.ValidationError("objects must be a list of integers")
|
||||
object_class = self.get_object_class(object_type)
|
||||
count = object_class.objects.filter(id__in=objects).count()
|
||||
count = object_class.objects.filter(id__in=in_range_ids(objects)).count()
|
||||
if not count == len(objects):
|
||||
raise serializers.ValidationError(
|
||||
"Some ids in objects don't exist or were specified twice.",
|
||||
@@ -3233,10 +3303,14 @@ class WorkflowTriggerSerializer(serializers.ModelSerializer[WorkflowTrigger]):
|
||||
]
|
||||
|
||||
def create(self, validated_data):
|
||||
# The id is only meaningful when this is nested in a workflow. On its own
|
||||
# a client chosen id would collide with, or overwrite, another row
|
||||
validated_data.pop("id", None)
|
||||
WorkflowTriggerSerializer.normalize_workflow_trigger_sources(validated_data)
|
||||
return super().create(validated_data)
|
||||
|
||||
def update(self, instance, validated_data):
|
||||
validated_data.pop("id", None)
|
||||
WorkflowTriggerSerializer.normalize_workflow_trigger_sources(validated_data)
|
||||
return super().update(instance, validated_data)
|
||||
|
||||
@@ -3278,6 +3352,34 @@ class WorkflowActionWebhookSerializer(
|
||||
]
|
||||
|
||||
|
||||
def save_action_email_and_webhook(action, email_data, webhook_data) -> None:
|
||||
"""
|
||||
Store the nested email and webhook of a workflow action on the action's own rows.
|
||||
An id in the payload is never used, it could name a row that belongs to another
|
||||
action. An action with no row of that kind gets a new one. The data must already
|
||||
be cleaned by the nested serializers, an unknown key would be a model error.
|
||||
"""
|
||||
created = False
|
||||
for data, model, attribute in (
|
||||
(email_data, WorkflowActionEmail, "email"),
|
||||
(webhook_data, WorkflowActionWebhook, "webhook"),
|
||||
):
|
||||
if data is None:
|
||||
continue
|
||||
values = {key: value for key, value in data.items() if key != "id"}
|
||||
existing = getattr(action, attribute)
|
||||
if existing is not None:
|
||||
# Change the loaded row, a response is built from it
|
||||
for key, value in values.items():
|
||||
setattr(existing, key, value)
|
||||
existing.save()
|
||||
else:
|
||||
setattr(action, attribute, model.objects.create(**values))
|
||||
created = True
|
||||
if created:
|
||||
action.save()
|
||||
|
||||
|
||||
class WorkflowActionSerializer(serializers.ModelSerializer[WorkflowAction]):
|
||||
id = serializers.IntegerField(required=False, allow_null=True)
|
||||
assign_correspondent = CorrespondentField(allow_null=True, required=False)
|
||||
@@ -3329,6 +3431,22 @@ class WorkflowActionSerializer(serializers.ModelSerializer[WorkflowAction]):
|
||||
"ai_overwrite_existing",
|
||||
]
|
||||
|
||||
def create(self, validated_data):
|
||||
validated_data.pop("id", None)
|
||||
email_data = validated_data.pop("email", None)
|
||||
webhook_data = validated_data.pop("webhook", None)
|
||||
instance = super().create(validated_data)
|
||||
save_action_email_and_webhook(instance, email_data, webhook_data)
|
||||
return instance
|
||||
|
||||
def update(self, instance, validated_data):
|
||||
validated_data.pop("id", None)
|
||||
email_data = validated_data.pop("email", None)
|
||||
webhook_data = validated_data.pop("webhook", None)
|
||||
instance = super().update(instance, validated_data)
|
||||
save_action_email_and_webhook(instance, email_data, webhook_data)
|
||||
return instance
|
||||
|
||||
def validate(self, attrs):
|
||||
if "assign_title" in attrs and attrs["assign_title"] is not None:
|
||||
if len(attrs["assign_title"]) == 0:
|
||||
@@ -3343,6 +3461,10 @@ class WorkflowActionSerializer(serializers.ModelSerializer[WorkflowAction]):
|
||||
)
|
||||
|
||||
if attrs.get("assign_custom_fields_values"):
|
||||
if not isinstance(attrs["assign_custom_fields_values"], dict):
|
||||
raise serializers.ValidationError(
|
||||
{"assign_custom_fields_values": "Must be an object"},
|
||||
)
|
||||
# Empty strings treated as None to avoid unexpected behavior
|
||||
attrs["assign_custom_fields_values"] = {
|
||||
field_id: (None if value == "" else value)
|
||||
@@ -3405,7 +3527,11 @@ class WorkflowActionSerializer(serializers.ModelSerializer[WorkflowAction]):
|
||||
|
||||
|
||||
class WorkflowSerializer(serializers.ModelSerializer[Workflow]):
|
||||
order = serializers.IntegerField(required=False)
|
||||
order = serializers.IntegerField(
|
||||
required=False,
|
||||
min_value=INT32_MIN,
|
||||
max_value=INT32_MAX,
|
||||
)
|
||||
|
||||
triggers = WorkflowTriggerSerializer(many=True)
|
||||
actions = WorkflowActionSerializer(many=True)
|
||||
@@ -3491,6 +3617,10 @@ class WorkflowSerializer(serializers.ModelSerializer[Workflow]):
|
||||
) -> None:
|
||||
set_triggers = []
|
||||
set_actions = []
|
||||
# Only rows already attached to this workflow may be updated by id, an id
|
||||
# from anywhere else would take over or overwrite another workflow's row
|
||||
own_trigger_ids = set(instance.triggers.values_list("pk", flat=True))
|
||||
own_action_ids = set(instance.actions.values_list("pk", flat=True))
|
||||
|
||||
if triggers is not None and triggers is not serializers.empty:
|
||||
for trigger in triggers:
|
||||
@@ -3523,8 +3653,10 @@ class WorkflowSerializer(serializers.ModelSerializer[Workflow]):
|
||||
)
|
||||
# Convert sources to strings to handle django-multiselectfield v1.0 changes
|
||||
WorkflowTriggerSerializer.normalize_workflow_trigger_sources(trigger)
|
||||
trigger_id = trigger.pop("id", None)
|
||||
trigger_instance, _ = WorkflowTrigger.objects.update_or_create(
|
||||
id=trigger.get("id"),
|
||||
# A row that is not already part of this workflow is never reused
|
||||
id=trigger_id if trigger_id in own_trigger_ids else None,
|
||||
defaults=trigger,
|
||||
)
|
||||
if filter_has_tags is not None:
|
||||
@@ -3582,30 +3714,24 @@ class WorkflowSerializer(serializers.ModelSerializer[Workflow]):
|
||||
email_data = action.pop("email", None)
|
||||
webhook_data = action.pop("webhook", None)
|
||||
|
||||
action_id = action.pop("id", None)
|
||||
action_instance, _ = WorkflowAction.objects.update_or_create(
|
||||
id=action.get("id"),
|
||||
# A row that is not already part of this workflow is never reused
|
||||
id=action_id if action_id in own_action_ids else None,
|
||||
defaults=action,
|
||||
)
|
||||
|
||||
if email_data is not None:
|
||||
serializer = WorkflowActionEmailSerializer(data=email_data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
email, _ = WorkflowActionEmail.objects.update_or_create(
|
||||
id=email_data.get("id"),
|
||||
defaults=serializer.validated_data,
|
||||
)
|
||||
action_instance.email = email
|
||||
action_instance.save()
|
||||
email_data = serializer.validated_data
|
||||
|
||||
if webhook_data is not None:
|
||||
serializer = WorkflowActionWebhookSerializer(data=webhook_data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
webhook, _ = WorkflowActionWebhook.objects.update_or_create(
|
||||
id=webhook_data.get("id"),
|
||||
defaults=serializer.validated_data,
|
||||
)
|
||||
action_instance.webhook = webhook
|
||||
action_instance.save()
|
||||
webhook_data = serializer.validated_data
|
||||
|
||||
save_action_email_and_webhook(action_instance, email_data, webhook_data)
|
||||
|
||||
if assign_tags is not None:
|
||||
action_instance.assign_tags.set(assign_tags)
|
||||
@@ -3706,13 +3832,22 @@ class TrashSerializer(SerializerWithPerms):
|
||||
)
|
||||
|
||||
def validate_documents(self, documents: list[int]) -> list[int]:
|
||||
count = Document.deleted_objects.filter(id__in=documents).count()
|
||||
count = Document.deleted_objects.filter(
|
||||
id__in=in_range_ids(documents),
|
||||
).count()
|
||||
if not count == len(documents):
|
||||
raise serializers.ValidationError(
|
||||
"Some documents in the list have not yet been deleted.",
|
||||
)
|
||||
return documents
|
||||
|
||||
def validate(self, attrs):
|
||||
if attrs.get("action") == "restore" and "documents" not in attrs:
|
||||
raise serializers.ValidationError(
|
||||
{"documents": "This field is required to restore documents."},
|
||||
)
|
||||
return attrs
|
||||
|
||||
|
||||
class StoragePathTestSerializer(SerializerWithPerms):
|
||||
path = serializers.CharField(
|
||||
|
||||
+10
-21
@@ -6,7 +6,6 @@ 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
|
||||
@@ -897,26 +896,25 @@ 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()
|
||||
if final_path.exists():
|
||||
final_path.unlink()
|
||||
shutil.move(temp_zip_path, final_path)
|
||||
|
||||
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)
|
||||
|
||||
bundle.file_path = f"{bundle.slug}.zip"
|
||||
bundle.size_bytes = final_path.stat().st_size
|
||||
@@ -947,16 +945,7 @@ 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
|
||||
|
||||
@@ -75,3 +75,17 @@ def searchable_document(_search_index: None) -> "Document":
|
||||
def mock_zone_ocr_run(mocker: "MockerFixture") -> "MagicMock":
|
||||
"""Patch the subprocess runner used by zone OCR (tesseract and pdftoppm)."""
|
||||
return mocker.patch("documents.zone_ocr.subprocess.run")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def config_id(db: None) -> int:
|
||||
"""
|
||||
The id of the application configuration row. A migration creates it, but a test
|
||||
that flushes the database in the same worker removes it, so make sure it exists.
|
||||
"""
|
||||
from paperless.models import ApplicationConfiguration
|
||||
|
||||
config = ApplicationConfiguration.objects.first()
|
||||
if config is None:
|
||||
config = ApplicationConfiguration.objects.create()
|
||||
return config.pk
|
||||
@@ -1069,6 +1069,13 @@ 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,
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
import pytest
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from documents.models import CustomField
|
||||
from paperless_testing.http import send_json
|
||||
|
||||
|
||||
class TestCustomFieldExtraData:
|
||||
@pytest.mark.parametrize("extra_data", [[1], "text", 5, True])
|
||||
def test_extra_data_that_is_not_an_object_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
extra_data: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A custom field is created with extra data that is not an object
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/custom_fields/",
|
||||
{"name": "field", "data_type": "string", "extra_data": extra_data},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert "extra_data" in response.data
|
||||
|
||||
@pytest.mark.parametrize("extra_data", [None, {}])
|
||||
def test_null_or_empty_extra_data_is_accepted(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
extra_data: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A string custom field has null or empty extra data
|
||||
THEN:
|
||||
- It is created
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/custom_fields/",
|
||||
{"name": "field", "data_type": "string", "extra_data": extra_data},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("extra_data", "term"),
|
||||
[
|
||||
pytest.param([1], "1", id="list"),
|
||||
pytest.param(
|
||||
{"select_options": [1, "x"]},
|
||||
"select",
|
||||
id="options-not-objects",
|
||||
),
|
||||
pytest.param(
|
||||
{"select_options": None, "note": "zzz"},
|
||||
"zzz",
|
||||
id="options-null",
|
||||
),
|
||||
pytest.param(
|
||||
{"select_options": 5, "note": "zzz"},
|
||||
"zzz",
|
||||
id="options-a-number",
|
||||
),
|
||||
pytest.param(
|
||||
{"select_options": [{"label": None, "id": "zzz"}]},
|
||||
"zzz",
|
||||
id="label-missing",
|
||||
),
|
||||
pytest.param(
|
||||
{"select_options": [{"label": 5, "id": "zzz"}]},
|
||||
"zzz",
|
||||
id="label-not-a-string",
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_the_deprecated_custom_fields_filter_survives_odd_stored_data(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
db: None,
|
||||
extra_data: object,
|
||||
term: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A custom field whose stored extra data an older version allowed
|
||||
WHEN:
|
||||
- Documents are filtered with the deprecated custom_fields__icontains
|
||||
THEN:
|
||||
- The request succeeds
|
||||
"""
|
||||
CustomField.objects.create(
|
||||
name="legacy",
|
||||
data_type=CustomField.FieldDataType.SELECT,
|
||||
extra_data=extra_data,
|
||||
)
|
||||
|
||||
response = admin_client.get(
|
||||
"/api/documents/",
|
||||
{"custom_fields__icontains": term},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
@@ -2089,6 +2089,38 @@ 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()),
|
||||
|
||||
@@ -0,0 +1,741 @@
|
||||
import pytest
|
||||
from django.contrib.auth.models import User
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from documents.models import UiSettings
|
||||
from documents.models import WorkflowAction
|
||||
from documents.models import WorkflowActionEmail
|
||||
from paperless_testing.http import send_json
|
||||
|
||||
EMAIL = {
|
||||
"subject": "Subject",
|
||||
"body": "Body",
|
||||
"to": "someone@example.com",
|
||||
"include_document": False,
|
||||
}
|
||||
|
||||
|
||||
class TestObjectJsonBody:
|
||||
@pytest.mark.parametrize("body", [[], [1, 2], True, 1, 1.5, None, "text"])
|
||||
@pytest.mark.parametrize(
|
||||
("method", "path"),
|
||||
[
|
||||
pytest.param("PATCH", "/api/workflow_triggers/1/", id="trigger-patch"),
|
||||
pytest.param("PATCH", "/api/workflow_actions/1/", id="action-patch"),
|
||||
pytest.param("POST", "/api/documents/bulk_edit/", id="bulk-edit"),
|
||||
pytest.param(
|
||||
"POST",
|
||||
"/api/processed_mail/bulk_delete/",
|
||||
id="processed-mail-bulk-delete",
|
||||
),
|
||||
pytest.param("POST", "/api/tags/", id="tags-create"),
|
||||
],
|
||||
)
|
||||
def test_body_that_is_not_an_object_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
method: str,
|
||||
path: str,
|
||||
body: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A JSON body that is a list or a scalar is sent
|
||||
THEN:
|
||||
- The response is a 400, never a server error
|
||||
"""
|
||||
response = send_json(admin_client, method, path, body)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
|
||||
class TestNullAndWrongTypeFields:
|
||||
@pytest.mark.parametrize("password", [["x"], 5, {"a": 1}, True])
|
||||
def test_password_that_is_not_a_string_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
admin_user: User,
|
||||
password: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A user
|
||||
WHEN:
|
||||
- The password is sent as something other than a string
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/users/{admin_user.pk}/",
|
||||
{"password": password},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert "password" in response.data
|
||||
|
||||
@pytest.mark.parametrize("ui_settings", [None, {}])
|
||||
def test_ui_settings_that_are_null_or_empty_are_accepted_and_readable(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
ui_settings: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- UI settings are saved as null or with an unexpected update_checking
|
||||
THEN:
|
||||
- The request does not fail with a server error
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/ui_settings/",
|
||||
{"settings": ui_settings},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
# What was saved must also be readable, null used to break the GET afterwards
|
||||
assert admin_client.get("/api/ui_settings/").status_code == status.HTTP_200_OK
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ui_settings",
|
||||
[[1], "text", 5, {"update_checking": [1]}, {"update_checking": "x"}],
|
||||
)
|
||||
def test_ui_settings_of_the_wrong_shape_are_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
ui_settings: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- UI settings are saved that are not an object, or have a mistyped
|
||||
update_checking
|
||||
THEN:
|
||||
- The response is a 400, not stored to break the next read
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/ui_settings/",
|
||||
{"settings": ui_settings},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"stored",
|
||||
[None, [1], "text", {"update_checking": "x"}, {"update_checking": [1]}],
|
||||
)
|
||||
def test_reading_ui_settings_saved_in_an_unexpected_shape_still_works(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
admin_user: User,
|
||||
stored: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- UI settings stored in a shape the API no longer accepts, as older
|
||||
versions allowed it
|
||||
WHEN:
|
||||
- The settings are read
|
||||
THEN:
|
||||
- The request succeeds
|
||||
"""
|
||||
UiSettings.objects.update_or_create(
|
||||
user=admin_user,
|
||||
defaults={"settings": stored},
|
||||
)
|
||||
|
||||
response = admin_client.get("/api/ui_settings/")
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"field",
|
||||
["llm_api_key", "llm_embedding_api_key", "remote_ocr_api_key"],
|
||||
)
|
||||
@pytest.mark.parametrize("value", [5, ["a"], {"a": 1}, True])
|
||||
def test_config_api_key_that_is_not_a_string_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
config_id: int,
|
||||
field: str,
|
||||
value: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- The application configuration
|
||||
WHEN:
|
||||
- An obfuscated key field is sent as something other than a string
|
||||
THEN:
|
||||
- The response is a 400, not a server error
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/config/{config_id}/",
|
||||
{field: value},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert field in response.data
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"display_fields",
|
||||
[["custom_field_abc"], ["custom_field_"], ["xcustom_field_1"]],
|
||||
)
|
||||
def test_saved_view_custom_field_name_must_be_well_formed(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
display_fields: list,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A saved view lists a custom field display name without a numeric id
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/saved_views/",
|
||||
{
|
||||
"name": "view",
|
||||
"show_on_dashboard": False,
|
||||
"show_in_sidebar": False,
|
||||
"sort_field": "created",
|
||||
"filter_rules": [],
|
||||
"display_fields": display_fields,
|
||||
},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
@pytest.mark.parametrize("display_fields", [5, True, {"a": 1}, "text"])
|
||||
def test_saved_view_display_fields_must_be_a_list(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
display_fields: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A saved view is created with display fields that are not a list
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/saved_views/",
|
||||
{
|
||||
"name": "view",
|
||||
"show_on_dashboard": False,
|
||||
"show_in_sidebar": False,
|
||||
"sort_field": "created",
|
||||
"filter_rules": [],
|
||||
"display_fields": display_fields,
|
||||
},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
@pytest.mark.parametrize("display_fields", [[None], [5], [["x"]]])
|
||||
def test_saved_view_display_field_that_is_not_a_string_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
display_fields: list,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A saved view is created with display fields that are not strings
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/saved_views/",
|
||||
{
|
||||
"name": "view",
|
||||
"show_on_dashboard": False,
|
||||
"show_in_sidebar": False,
|
||||
"sort_field": "created",
|
||||
"filter_rules": [],
|
||||
"display_fields": display_fields,
|
||||
},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"extra_data",
|
||||
[None, {}, {"select_options": None}, {"select_options": [1, 2]}, [1]],
|
||||
)
|
||||
def test_select_custom_field_without_valid_options_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
extra_data: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A select custom field is created without usable options
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/custom_fields/",
|
||||
{"name": "select", "data_type": "select", "extra_data": extra_data},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
def test_monetary_custom_field_with_null_extra_data_is_accepted(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A monetary custom field is created with null extra data
|
||||
THEN:
|
||||
- It is created
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/custom_fields/",
|
||||
{"name": "money", "data_type": "monetary", "extra_data": None},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
|
||||
@pytest.mark.parametrize("values", [[1], "text", 5])
|
||||
def test_workflow_custom_field_values_must_be_an_object(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
values: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A workflow action carries custom field values that are not an object
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/workflows/",
|
||||
{
|
||||
"name": "workflow",
|
||||
"order": 0,
|
||||
"enabled": True,
|
||||
"triggers": [{"type": 2, "sources": [1], "matching_algorithm": 0}],
|
||||
"actions": [{"type": 1, "assign_custom_fields_values": values}],
|
||||
},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
|
||||
class TestRequiredFields:
|
||||
def test_share_link_requires_a_document(self, admin_client: APIClient) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A share link is created without a document
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(admin_client, "POST", "/api/share_links/", {})
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert "document" in response.data
|
||||
|
||||
def test_restoring_from_the_trash_requires_documents(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- The trash is asked to restore without saying which documents
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(admin_client, "POST", "/api/trash/", {"action": "restore"})
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert "documents" in response.data
|
||||
|
||||
@pytest.mark.parametrize("action", ["restore", "empty"])
|
||||
def test_trash_document_id_beyond_the_database_range_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
action: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- The trash is given a document id no row can have
|
||||
THEN:
|
||||
- The response is a 400, as for any document that is not in the trash
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/trash/",
|
||||
{"action": action, "documents": [2**70]},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
@pytest.mark.parametrize("method", ["split", "delete_pages", "edit_pdf"])
|
||||
def test_single_document_bulk_methods_reject_an_empty_selection(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
method: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A method that works on exactly one document gets none
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/documents/bulk_edit/",
|
||||
{
|
||||
"documents": [],
|
||||
"method": method,
|
||||
"parameters": {
|
||||
"pages": "1",
|
||||
"operations": [{"page": 1}],
|
||||
"split_pages": [[1]],
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
def test_edit_pdf_endpoint_rejects_an_empty_selection(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- The edit_pdf endpoint gets no documents
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/documents/edit_pdf/",
|
||||
{"documents": [], "operations": [{"page": 1}]},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
|
||||
class TestSharedByFilter:
|
||||
@pytest.mark.parametrize("value", ["false", "abc", "1.5", str(2**63)])
|
||||
def test_non_integer_user_id_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
value: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- shared_by__id is not an integer user id
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = admin_client.get("/api/documents/", {"shared_by__id": value})
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
@pytest.mark.parametrize("value", ["", "1"])
|
||||
def test_empty_or_valid_user_id_works(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
value: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- shared_by__id is empty or a user id
|
||||
THEN:
|
||||
- The request succeeds
|
||||
"""
|
||||
response = admin_client.get("/api/documents/", {"shared_by__id": value})
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
|
||||
|
||||
class TestStandaloneWorkflowActions:
|
||||
def test_create_with_nested_email(self, admin_client: APIClient) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- An email action is created through the standalone endpoint
|
||||
THEN:
|
||||
- The action and its email are both stored
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/workflow_actions/",
|
||||
{"type": WorkflowAction.WorkflowActionType.EMAIL, "email": EMAIL},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
action = WorkflowAction.objects.get(pk=response.data["id"])
|
||||
assert action.email is not None
|
||||
assert action.email.subject == "Subject"
|
||||
|
||||
def test_update_changes_the_existing_email_row(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An email action
|
||||
WHEN:
|
||||
- Its email is changed through the standalone endpoint
|
||||
THEN:
|
||||
- The existing email row is updated, no new row is made
|
||||
"""
|
||||
created = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/workflow_actions/",
|
||||
{"type": WorkflowAction.WorkflowActionType.EMAIL, "email": EMAIL},
|
||||
)
|
||||
action = WorkflowAction.objects.get(pk=created.data["id"])
|
||||
email_id = action.email_id
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/workflow_actions/{action.pk}/",
|
||||
{"email": {**EMAIL, "subject": "Changed"}},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
# The response must show the saved value, not the row loaded before the update
|
||||
assert response.data["email"]["subject"] == "Changed"
|
||||
action.refresh_from_db()
|
||||
assert action.email_id == email_id
|
||||
assert WorkflowActionEmail.objects.get(pk=email_id).subject == "Changed"
|
||||
assert WorkflowActionEmail.objects.count() == 1
|
||||
|
||||
def test_null_email_leaves_the_existing_email_alone(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An email action
|
||||
WHEN:
|
||||
- It is patched with a null email
|
||||
THEN:
|
||||
- The email is kept, null is a no-op as in the nested workflow serializer
|
||||
"""
|
||||
created = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/workflow_actions/",
|
||||
{"type": WorkflowAction.WorkflowActionType.EMAIL, "email": EMAIL},
|
||||
)
|
||||
action = WorkflowAction.objects.get(pk=created.data["id"])
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/workflow_actions/{action.pk}/",
|
||||
{"email": None},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
action.refresh_from_db()
|
||||
assert action.email is not None
|
||||
assert action.email.subject == "Subject"
|
||||
|
||||
def test_an_id_in_the_payload_cannot_reach_another_actions_email(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An email action
|
||||
WHEN:
|
||||
- A second action is created with the first action's email id in its payload
|
||||
THEN:
|
||||
- The first email is untouched and the second action gets its own row
|
||||
"""
|
||||
first = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/workflow_actions/",
|
||||
{"type": WorkflowAction.WorkflowActionType.EMAIL, "email": EMAIL},
|
||||
)
|
||||
first_email = WorkflowAction.objects.get(pk=first.data["id"]).email
|
||||
|
||||
second = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/workflow_actions/",
|
||||
{
|
||||
"type": WorkflowAction.WorkflowActionType.EMAIL,
|
||||
"email": {**EMAIL, "id": first_email.pk, "subject": "Hijacked"},
|
||||
},
|
||||
)
|
||||
|
||||
assert second.status_code == status.HTTP_201_CREATED
|
||||
first_email.refresh_from_db()
|
||||
assert first_email.subject == "Subject"
|
||||
assert WorkflowAction.objects.get(pk=second.data["id"]).email_id != (
|
||||
first_email.pk
|
||||
)
|
||||
|
||||
|
||||
BEYOND_THE_DATABASE = 2**70
|
||||
|
||||
|
||||
class TestIdListsBeyondTheDatabaseRange:
|
||||
@pytest.mark.parametrize(
|
||||
("path", "body"),
|
||||
[
|
||||
pytest.param(
|
||||
"/api/documents/bulk_edit/",
|
||||
{"documents": [BEYOND_THE_DATABASE], "method": "delete"},
|
||||
id="bulk-edit-documents",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/bulk_edit/",
|
||||
{
|
||||
"documents": [],
|
||||
"method": "modify_tags",
|
||||
"parameters": {"add_tags": [BEYOND_THE_DATABASE]},
|
||||
},
|
||||
id="bulk-edit-tags",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/bulk_edit/",
|
||||
{
|
||||
"documents": [],
|
||||
"method": "modify_custom_fields",
|
||||
"parameters": {
|
||||
"add_custom_fields": [BEYOND_THE_DATABASE],
|
||||
"remove_custom_fields": [],
|
||||
},
|
||||
},
|
||||
id="bulk-edit-custom-fields",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/delete/",
|
||||
{"documents": [BEYOND_THE_DATABASE]},
|
||||
id="delete",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/reprocess/",
|
||||
{"documents": [BEYOND_THE_DATABASE]},
|
||||
id="reprocess",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/rotate/",
|
||||
{"documents": [BEYOND_THE_DATABASE], "degrees": 90},
|
||||
id="rotate",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/merge/",
|
||||
{"documents": [BEYOND_THE_DATABASE, BEYOND_THE_DATABASE + 1]},
|
||||
id="merge",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/bulk_download/",
|
||||
{"documents": [BEYOND_THE_DATABASE], "content": "both"},
|
||||
id="bulk-download",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/selection_data/",
|
||||
{"documents": [BEYOND_THE_DATABASE]},
|
||||
id="selection-data",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/share_link_bundles/",
|
||||
{"document_ids": [BEYOND_THE_DATABASE], "file_version": "archive"},
|
||||
id="share-link-bundle",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/bulk_edit_objects/",
|
||||
{
|
||||
"objects": [BEYOND_THE_DATABASE],
|
||||
"object_type": "tags",
|
||||
"operation": "delete",
|
||||
},
|
||||
id="bulk-edit-objects",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/tasks/acknowledge/",
|
||||
{"tasks": [BEYOND_THE_DATABASE]},
|
||||
id="acknowledge-tasks",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/trash/",
|
||||
{"action": "restore", "documents": [BEYOND_THE_DATABASE]},
|
||||
id="trash",
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_id_no_row_can_have_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
path: str,
|
||||
body: dict,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A list of ids includes one larger than a database column can hold
|
||||
THEN:
|
||||
- The response is a 400 like any id that does not exist, not a server
|
||||
error
|
||||
"""
|
||||
response = send_json(admin_client, "POST", path, body)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
@@ -0,0 +1,446 @@
|
||||
import pytest
|
||||
from django.contrib.auth.models import User
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from documents.models import Correspondent
|
||||
from documents.models import WorkflowAction
|
||||
from documents.models import WorkflowTrigger
|
||||
from paperless_mail.models import MailAccount
|
||||
from paperless_testing.http import send_json
|
||||
|
||||
ACCOUNT = {
|
||||
"name": "Email",
|
||||
"username": "username",
|
||||
"password": "password",
|
||||
"imap_server": "server.example.com",
|
||||
"imap_port": 993,
|
||||
"imap_security": MailAccount.ImapSecurity.SSL,
|
||||
"character_set": "UTF-8",
|
||||
}
|
||||
|
||||
TRIGGER = {"type": 2, "sources": [1, 2, 3], "matching_algorithm": 0}
|
||||
|
||||
|
||||
def create_account(client: APIClient) -> int:
|
||||
response = send_json(client, "POST", "/api/mail_accounts/", ACCOUNT)
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
return response.data["id"]
|
||||
|
||||
|
||||
class TestMailBounds:
|
||||
@pytest.mark.parametrize("port", [-1, 0, 65536, 2**40])
|
||||
def test_imap_port_outside_the_port_range_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
port: int,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A mail account is created with a port that cannot exist
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_accounts/",
|
||||
{**ACCOUNT, "imap_port": port},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert "imap_port" in response.data
|
||||
|
||||
@pytest.mark.parametrize("port", [1, 993, 65535])
|
||||
def test_imap_port_inside_the_range_is_accepted(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
port: int,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A mail account is created with a valid port
|
||||
THEN:
|
||||
- It is created
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_accounts/",
|
||||
{**ACCOUNT, "imap_port": port},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
|
||||
@pytest.mark.parametrize("method", ["PATCH", "PUT"])
|
||||
def test_updating_to_an_impossible_port_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
method: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A mail account
|
||||
WHEN:
|
||||
- It is updated with a negative port
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
account_id = create_account(admin_client)
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
method,
|
||||
f"/api/mail_accounts/{account_id}/",
|
||||
{**ACCOUNT, "imap_port": -5},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
@pytest.mark.parametrize("order", [2**15, -(2**15) - 1, 2**40])
|
||||
def test_mail_rule_order_beyond_a_smallint_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
order: int,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A mail account
|
||||
WHEN:
|
||||
- A rule is created with an order its column cannot hold
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
account_id = create_account(admin_client)
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_rules/",
|
||||
{"name": "rule", "account": account_id, "action": 3, "order": order},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert "order" in response.data
|
||||
|
||||
@pytest.mark.parametrize("order", [2**15 - 1, -(2**15)])
|
||||
def test_mail_rule_order_at_the_limits_is_accepted(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
order: int,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A mail account
|
||||
WHEN:
|
||||
- A rule is created with the largest or smallest order
|
||||
THEN:
|
||||
- It is created
|
||||
"""
|
||||
account_id = create_account(admin_client)
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_rules/",
|
||||
{"name": "rule", "account": account_id, "action": 3, "order": order},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("length", "expected"),
|
||||
[(256, status.HTTP_201_CREATED), (257, status.HTTP_400_BAD_REQUEST)],
|
||||
)
|
||||
def test_mail_rule_action_parameter_must_fit_the_column(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
length: int,
|
||||
expected: int,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A mail account
|
||||
WHEN:
|
||||
- A rule is created with an action parameter at, or past, the column size
|
||||
THEN:
|
||||
- It is created, or rejected, accordingly
|
||||
"""
|
||||
account_id = create_account(admin_client)
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_rules/",
|
||||
{
|
||||
"name": "rule",
|
||||
"account": account_id,
|
||||
"action": 3,
|
||||
"action_parameter": "x" * length,
|
||||
},
|
||||
)
|
||||
|
||||
assert response.status_code == expected
|
||||
|
||||
def test_updating_a_mail_rule_to_an_impossible_order_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A mail rule
|
||||
WHEN:
|
||||
- It is patched with an order beyond a smallint
|
||||
THEN:
|
||||
- The response is a 400
|
||||
"""
|
||||
account_id = create_account(admin_client)
|
||||
rule = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_rules/",
|
||||
{"name": "rule", "account": account_id, "action": 3},
|
||||
)
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/mail_rules/{rule.data['id']}/",
|
||||
{"order": 2**40},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
|
||||
class TestWorkflowOrder:
|
||||
@pytest.mark.parametrize(
|
||||
("order", "expected"),
|
||||
[
|
||||
(2**31, status.HTTP_400_BAD_REQUEST),
|
||||
(-(2**31) - 1, status.HTTP_400_BAD_REQUEST),
|
||||
(2**40, status.HTTP_400_BAD_REQUEST),
|
||||
(2**31 - 1, status.HTTP_201_CREATED),
|
||||
(-(2**31), status.HTTP_201_CREATED),
|
||||
],
|
||||
)
|
||||
def test_workflow_order_must_fit_the_column(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
order: int,
|
||||
expected: int,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A workflow is created with an order beyond a 32 bit integer, or exactly
|
||||
at its limits
|
||||
THEN:
|
||||
- It is rejected, or created, accordingly
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/workflows/",
|
||||
{
|
||||
"name": "workflow",
|
||||
"order": order,
|
||||
"enabled": True,
|
||||
"triggers": [TRIGGER],
|
||||
"actions": [{"type": 1, "assign_title": "title"}],
|
||||
},
|
||||
)
|
||||
|
||||
assert response.status_code == expected
|
||||
|
||||
|
||||
class TestStandaloneWorkflowRowIds:
|
||||
def test_trigger_created_with_an_existing_id_gets_its_own(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An existing workflow trigger
|
||||
WHEN:
|
||||
- A new trigger is created with that trigger's id in the payload
|
||||
THEN:
|
||||
- A new row is created and the existing one is untouched
|
||||
"""
|
||||
existing = WorkflowTrigger.objects.create(
|
||||
type=2,
|
||||
sources="1",
|
||||
matching_algorithm=0,
|
||||
)
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/workflow_triggers/",
|
||||
{**TRIGGER, "id": existing.pk},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
assert response.data["id"] != existing.pk
|
||||
assert WorkflowTrigger.objects.count() == 2
|
||||
|
||||
def test_action_created_with_an_existing_id_gets_its_own(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An existing workflow action
|
||||
WHEN:
|
||||
- A new action is created with that action's id in the payload
|
||||
THEN:
|
||||
- A new row is created and the existing one is untouched
|
||||
"""
|
||||
existing = WorkflowAction.objects.create(type=1, assign_title="original")
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/workflow_actions/",
|
||||
{"type": 1, "assign_title": "new", "id": existing.pk},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
assert response.data["id"] != existing.pk
|
||||
existing.refresh_from_db()
|
||||
assert existing.assign_title == "original"
|
||||
|
||||
def test_put_cannot_overwrite_another_trigger_through_the_body_id(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Two workflow triggers
|
||||
WHEN:
|
||||
- One is replaced with a body that carries the other's id
|
||||
THEN:
|
||||
- Only the trigger named in the URL changes
|
||||
"""
|
||||
target = WorkflowTrigger.objects.create(
|
||||
type=2,
|
||||
sources="1",
|
||||
matching_algorithm=0,
|
||||
)
|
||||
other = WorkflowTrigger.objects.create(
|
||||
type=2,
|
||||
sources="1",
|
||||
matching_algorithm=0,
|
||||
filter_filename="keep",
|
||||
)
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PUT",
|
||||
f"/api/workflow_triggers/{target.pk}/",
|
||||
{**TRIGGER, "filter_filename": "changed", "id": other.pk},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
target.refresh_from_db()
|
||||
other.refresh_from_db()
|
||||
assert target.filter_filename == "changed"
|
||||
assert other.filter_filename == "keep"
|
||||
|
||||
|
||||
class TestUniqueNameOnUpdate:
|
||||
@pytest.mark.parametrize("owner_kind", ["owned", "unowned"])
|
||||
def test_patching_to_an_existing_name_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
admin_user: User,
|
||||
owner_kind: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Two correspondents with the same owner, or none
|
||||
WHEN:
|
||||
- One is patched to the other's name without mentioning the owner
|
||||
THEN:
|
||||
- The response is a 400, as it is when creating a duplicate
|
||||
"""
|
||||
owner = admin_user if owner_kind == "owned" else None
|
||||
Correspondent.objects.create(name="taken", owner=owner)
|
||||
other = Correspondent.objects.create(name="free", owner=owner)
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/correspondents/{other.pk}/",
|
||||
{"name": "taken"},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
other.refresh_from_db()
|
||||
assert other.name == "free"
|
||||
|
||||
@pytest.mark.parametrize("owner_kind", ["owned", "unowned"])
|
||||
def test_renaming_to_a_free_name_or_keeping_the_name_still_works(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
admin_user: User,
|
||||
owner_kind: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A correspondent
|
||||
WHEN:
|
||||
- It is renamed to a free name, then saved again under that name
|
||||
THEN:
|
||||
- Both requests succeed
|
||||
"""
|
||||
correspondent = Correspondent.objects.create(
|
||||
name="before",
|
||||
owner=admin_user if owner_kind == "owned" else None,
|
||||
)
|
||||
|
||||
first = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/correspondents/{correspondent.pk}/",
|
||||
{"name": "after"},
|
||||
)
|
||||
second = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/correspondents/{correspondent.pk}/",
|
||||
{"name": "after"},
|
||||
)
|
||||
|
||||
assert first.status_code == status.HTTP_200_OK
|
||||
assert second.status_code == status.HTTP_200_OK
|
||||
|
||||
def test_the_same_name_under_a_different_owner_is_allowed(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
admin_user: User,
|
||||
regular_user: User,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Correspondents with the same name but different owners are allowed
|
||||
WHEN:
|
||||
- One correspondent is renamed to a name another owner already uses
|
||||
THEN:
|
||||
- The request succeeds
|
||||
"""
|
||||
Correspondent.objects.create(name="shared name", owner=regular_user)
|
||||
mine = Correspondent.objects.create(name="mine", owner=admin_user)
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/correspondents/{mine.pk}/",
|
||||
{"name": "shared name"},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
@@ -0,0 +1,139 @@
|
||||
import pytest
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from paperless_mail.models import MailAccount
|
||||
from paperless_testing.http import send_json
|
||||
|
||||
ACCOUNT = {
|
||||
"name": "Email",
|
||||
"username": "username",
|
||||
"password": "password",
|
||||
"imap_server": "server.example.com",
|
||||
"imap_port": 143,
|
||||
"imap_security": MailAccount.ImapSecurity.STARTTLS,
|
||||
"character_set": "UTF-8",
|
||||
}
|
||||
|
||||
|
||||
class TestStarttlsOnTheSslPort:
|
||||
def test_creating_a_starttls_account_on_port_993_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A mail account is created with STARTTLS on port 993
|
||||
THEN:
|
||||
- The response is a 400 naming the port, that pair can never connect
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_accounts/",
|
||||
{**ACCOUNT, "imap_port": 993},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert "imap_port" in response.data
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("security", "port"),
|
||||
[
|
||||
(MailAccount.ImapSecurity.STARTTLS, 143),
|
||||
(MailAccount.ImapSecurity.SSL, 993),
|
||||
(MailAccount.ImapSecurity.NONE, 143),
|
||||
],
|
||||
)
|
||||
def test_other_combinations_are_accepted(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
security: int,
|
||||
port: int,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A mail account is created with a sensible security and port pair
|
||||
THEN:
|
||||
- It is created
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_accounts/",
|
||||
{**ACCOUNT, "imap_security": security, "imap_port": port},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
|
||||
def test_the_account_test_endpoint_reports_it_as_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- The account test is run with STARTTLS on port 993
|
||||
THEN:
|
||||
- The response is a 400, the mailbox class refuses that pair with an
|
||||
error that used to escape as a 500
|
||||
"""
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_accounts/test/",
|
||||
{**ACCOUNT, "imap_port": 993},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
def test_a_patch_that_creates_the_pair_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A STARTTLS account on port 143, and an SSL account on port 993
|
||||
WHEN:
|
||||
- Only the port of the first, or only the security of the second, is patched
|
||||
THEN:
|
||||
- Both requests are a 400, the stored half of the pair counts
|
||||
"""
|
||||
starttls = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_accounts/",
|
||||
ACCOUNT,
|
||||
).data["id"]
|
||||
ssl = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_accounts/",
|
||||
{
|
||||
**ACCOUNT,
|
||||
"name": "Other",
|
||||
"imap_port": 993,
|
||||
"imap_security": MailAccount.ImapSecurity.SSL,
|
||||
},
|
||||
).data["id"]
|
||||
|
||||
port_patch = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/mail_accounts/{starttls}/",
|
||||
{"imap_port": 993},
|
||||
)
|
||||
security_patch = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/mail_accounts/{ssl}/",
|
||||
{"imap_security": MailAccount.ImapSecurity.STARTTLS},
|
||||
)
|
||||
|
||||
assert port_patch.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert security_patch.status_code == status.HTTP_400_BAD_REQUEST
|
||||
@@ -0,0 +1,405 @@
|
||||
import imaplib
|
||||
import shutil
|
||||
import socket
|
||||
import ssl
|
||||
|
||||
import pytest
|
||||
from django.contrib.auth.models import User
|
||||
from django.core import mail
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from pytest_django.fixtures import Settings
|
||||
from pytest_mock import MockerFixture
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from documents.models import Document
|
||||
from documents.models import SavedView
|
||||
from paperless_mail.mail import MailError
|
||||
from paperless_testing.dirs import PaperlessDirs
|
||||
from paperless_testing.factories import DocumentFactory
|
||||
from paperless_testing.factories import UserFactory
|
||||
from paperless_testing.http import send_json
|
||||
from paperless_testing.permissions import grant_global
|
||||
from paperless_testing.samples import SIMPLE_DIGITAL_PDF
|
||||
|
||||
EMAIL = {
|
||||
"addresses": "hello@paperless-ngx.com",
|
||||
"subject": "subject",
|
||||
"message": "message",
|
||||
"use_archive_version": False,
|
||||
}
|
||||
|
||||
MAIL_ACCOUNT = {
|
||||
"imap_server": "server.example.com",
|
||||
"imap_port": 993,
|
||||
"imap_security": 2,
|
||||
"username": "admin",
|
||||
"password": "secret",
|
||||
}
|
||||
|
||||
|
||||
class TestEmailSingleDocument:
|
||||
def _document_with_file(self, paperless_dirs: PaperlessDirs) -> Document:
|
||||
document = DocumentFactory.create(
|
||||
filename="test.pdf",
|
||||
mime_type="application/pdf",
|
||||
)
|
||||
shutil.copy(SIMPLE_DIGITAL_PDF, document.source_path)
|
||||
return document
|
||||
|
||||
def test_json_body_sends_the_email(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
paperless_dirs: PaperlessDirs,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A document with a file
|
||||
WHEN:
|
||||
- The per document email endpoint gets a JSON body
|
||||
THEN:
|
||||
- The email is sent, a JSON body used to crash on a QueryDict only call
|
||||
"""
|
||||
document = self._document_with_file(paperless_dirs)
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
f"/api/documents/{document.pk}/email/",
|
||||
EMAIL,
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert len(mail.outbox) == 1
|
||||
|
||||
def test_form_body_still_sends_the_email(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
paperless_dirs: PaperlessDirs,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A document with a file
|
||||
WHEN:
|
||||
- The endpoint gets a form encoded body
|
||||
THEN:
|
||||
- The email is sent
|
||||
"""
|
||||
document = self._document_with_file(paperless_dirs)
|
||||
|
||||
response = admin_client.post(
|
||||
f"/api/documents/{document.pk}/email/",
|
||||
EMAIL,
|
||||
format="multipart",
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert len(mail.outbox) == 1
|
||||
|
||||
def test_json_body_is_still_validated(self, admin_client: APIClient) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A document
|
||||
WHEN:
|
||||
- A JSON body without addresses is sent
|
||||
THEN:
|
||||
- The response is a 400 from the serializer, not a server error
|
||||
"""
|
||||
document = DocumentFactory.create()
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
f"/api/documents/{document.pk}/email/",
|
||||
{"subject": "only a subject"},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert "addresses" in response.data
|
||||
|
||||
|
||||
class TestMailAccountTest:
|
||||
def test_form_encoded_body_is_accepted(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
mocker: MockerFixture,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A mailbox that connects
|
||||
WHEN:
|
||||
- The account test gets a form encoded body, which is a read only QueryDict
|
||||
THEN:
|
||||
- The request succeeds, the view must not write into the request data
|
||||
"""
|
||||
mocker.patch("paperless_mail.views.get_mailbox")
|
||||
mocker.patch("paperless_mail.views.mailbox_login")
|
||||
|
||||
response = admin_client.post(
|
||||
"/api/mail_accounts/test/",
|
||||
MAIL_ACCOUNT,
|
||||
format="multipart",
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.data == {"success": True}
|
||||
|
||||
def test_write_only_serializer_fields_are_not_passed_to_the_model(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
mocker: MockerFixture,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A mailbox that connects
|
||||
WHEN:
|
||||
- The account test body carries set_permissions, which is not a model field
|
||||
THEN:
|
||||
- The request succeeds
|
||||
"""
|
||||
mocker.patch("paperless_mail.views.get_mailbox")
|
||||
mocker.patch("paperless_mail.views.mailbox_login")
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_accounts/test/",
|
||||
{
|
||||
**MAIL_ACCOUNT,
|
||||
"set_permissions": {"view": {"users": [], "groups": []}},
|
||||
},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
|
||||
def test_multipart_body_with_a_large_file_is_accepted(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
mocker: MockerFixture,
|
||||
settings: Settings,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A mailbox that connects, and uploads that spill to a temporary file
|
||||
WHEN:
|
||||
- The account test gets a multipart body that carries a large file
|
||||
THEN:
|
||||
- The request succeeds, copying the request data would try to deep copy
|
||||
the temporary file and fail
|
||||
"""
|
||||
settings.FILE_UPLOAD_MAX_MEMORY_SIZE = 10
|
||||
mocker.patch("paperless_mail.views.get_mailbox")
|
||||
mocker.patch("paperless_mail.views.mailbox_login")
|
||||
|
||||
response = admin_client.post(
|
||||
"/api/mail_accounts/test/",
|
||||
{
|
||||
**MAIL_ACCOUNT,
|
||||
"attachment": SimpleUploadedFile("junk.bin", b"0" * 1000),
|
||||
},
|
||||
format="multipart",
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"error",
|
||||
[
|
||||
pytest.param(ConnectionRefusedError, id="refused"),
|
||||
pytest.param(socket.gaierror, id="unknown-host"),
|
||||
pytest.param(TimeoutError, id="timeout"),
|
||||
pytest.param(ssl.SSLError, id="tls"),
|
||||
pytest.param(imaplib.IMAP4.error, id="imap-error"),
|
||||
pytest.param(UnicodeError, id="bad-host-name"),
|
||||
pytest.param(MailError, id="mail-error"),
|
||||
],
|
||||
)
|
||||
def test_connection_failures_are_reported_as_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
mocker: MockerFixture,
|
||||
error: type[Exception],
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A mailbox that cannot be reached
|
||||
WHEN:
|
||||
- The account test is run
|
||||
THEN:
|
||||
- The response is a 400 saying the server cannot be reached, that is the
|
||||
answer this endpoint exists to give
|
||||
"""
|
||||
mocker.patch("paperless_mail.views.get_mailbox", side_effect=error("boom"))
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/mail_accounts/test/",
|
||||
MAIL_ACCOUNT,
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert response.content == b"Unable to connect to server"
|
||||
|
||||
|
||||
class TestDeactivateTotp:
|
||||
def test_unknown_user_is_a_404_for_a_superuser(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A superuser
|
||||
WHEN:
|
||||
- TOTP is deactivated for a user id that does not exist
|
||||
THEN:
|
||||
- The response is a 404
|
||||
"""
|
||||
response = admin_client.post("/api/users/999999/deactivate_totp/")
|
||||
|
||||
assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||
|
||||
def test_non_numeric_user_id_is_a_404_for_a_superuser(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A superuser
|
||||
WHEN:
|
||||
- The user id is not a number
|
||||
THEN:
|
||||
- The response is a 404, not a server error
|
||||
"""
|
||||
response = admin_client.post("/api/users/abc/deactivate_totp/")
|
||||
|
||||
assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||
|
||||
def test_status_does_not_reveal_whether_another_user_exists(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
regular_user: User,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A regular user allowed to use the users API, and another user
|
||||
WHEN:
|
||||
- They deactivate TOTP for another existing user, and for one that does not
|
||||
exist
|
||||
THEN:
|
||||
- Both answers are a 403, so the status cannot be used to find user ids
|
||||
"""
|
||||
grant_global(regular_user, "add_user", "change_user")
|
||||
other = UserFactory.create(username="other")
|
||||
rest_api_client.force_authenticate(user=regular_user)
|
||||
|
||||
existing = rest_api_client.post(f"/api/users/{other.pk}/deactivate_totp/")
|
||||
missing = rest_api_client.post("/api/users/999999/deactivate_totp/")
|
||||
|
||||
assert existing.status_code == status.HTTP_403_FORBIDDEN
|
||||
assert missing.status_code == status.HTTP_403_FORBIDDEN
|
||||
|
||||
def test_a_user_can_reach_their_own_record(
|
||||
self,
|
||||
rest_api_client: APIClient,
|
||||
regular_user: User,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A regular user with no authenticator
|
||||
WHEN:
|
||||
- They deactivate TOTP for themselves
|
||||
THEN:
|
||||
- The lookup succeeds and the answer is that no TOTP was found
|
||||
"""
|
||||
grant_global(regular_user, "add_user", "change_user")
|
||||
rest_api_client.force_authenticate(user=regular_user)
|
||||
|
||||
response = rest_api_client.post(
|
||||
f"/api/users/{regular_user.pk}/deactivate_totp/",
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||
assert response.content == b"TOTP not found"
|
||||
|
||||
|
||||
class TestSavedViewPartialRules:
|
||||
def test_patch_with_a_rule_missing_its_type_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
admin_user: User,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A saved view
|
||||
WHEN:
|
||||
- It is patched with a filter rule that has no rule_type
|
||||
THEN:
|
||||
- The response is a 400, not a database error
|
||||
"""
|
||||
view = SavedView.objects.create(
|
||||
name="view",
|
||||
owner=admin_user,
|
||||
sort_field="created",
|
||||
)
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PATCH",
|
||||
f"/api/saved_views/{view.pk}/",
|
||||
{"filter_rules": [{"value": "1"}]},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert "filter_rules" in response.data
|
||||
|
||||
|
||||
class TestConfigFormBody:
|
||||
@pytest.mark.parametrize(
|
||||
"body",
|
||||
["language=", "llm_api_key=", "language=&llm_api_key="],
|
||||
)
|
||||
def test_form_encoded_empty_values_are_accepted(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
config_id: int,
|
||||
body: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- The application configuration
|
||||
WHEN:
|
||||
- A form encoded body with empty values is patched in
|
||||
THEN:
|
||||
- The request succeeds, the serializer used to write into the read only
|
||||
QueryDict
|
||||
"""
|
||||
response = admin_client.patch(
|
||||
f"/api/config/{config_id}/",
|
||||
data=body,
|
||||
content_type="application/x-www-form-urlencoded",
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
|
||||
def test_form_encoded_empty_json_field_is_a_clean_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
config_id: int,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- The application configuration
|
||||
WHEN:
|
||||
- An empty value for a JSON field arrives in a form encoded body
|
||||
THEN:
|
||||
- The response is a 400 naming the field, not a server error
|
||||
"""
|
||||
response = admin_client.patch(
|
||||
f"/api/config/{config_id}/",
|
||||
data="user_args=",
|
||||
content_type="application/x-www-form-urlencoded",
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert "user_args" in response.data
|
||||
@@ -1,3 +1,5 @@
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
from django.core.management import call_command
|
||||
from django.core.management.base import CommandError
|
||||
@@ -337,3 +339,41 @@ 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"]
|
||||
@@ -996,6 +996,9 @@ 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)
|
||||
|
||||
|
||||
@@ -0,0 +1,299 @@
|
||||
import json
|
||||
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from documents.models import WorkflowAction
|
||||
from documents.models import WorkflowActionEmail
|
||||
from documents.models import WorkflowTrigger
|
||||
from paperless_testing.http import send_json
|
||||
|
||||
EMAIL = {
|
||||
"subject": "original",
|
||||
"body": "body",
|
||||
"to": "someone@example.com",
|
||||
"include_document": False,
|
||||
}
|
||||
|
||||
|
||||
def workflow_body(name: str, *, trigger: dict, action: dict) -> dict:
|
||||
return {
|
||||
"name": name,
|
||||
"order": 0,
|
||||
"enabled": True,
|
||||
"triggers": [
|
||||
{"type": 2, "sources": [1], "matching_algorithm": 0, **trigger},
|
||||
],
|
||||
"actions": [{"type": 3, "email": EMAIL, **action}],
|
||||
}
|
||||
|
||||
|
||||
def make_workflow(client: APIClient, name: str) -> dict:
|
||||
response = send_json(
|
||||
client,
|
||||
"POST",
|
||||
"/api/workflows/",
|
||||
workflow_body(name, trigger={}, action={}),
|
||||
)
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
return response.data
|
||||
|
||||
|
||||
class TestWorkflowRowOwnership:
|
||||
def test_update_cannot_take_over_another_workflows_action(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Two workflows, each with an email action
|
||||
WHEN:
|
||||
- The first is updated with the id of the second one's action and a changed
|
||||
email
|
||||
THEN:
|
||||
- The second workflow's action and email are untouched, the first gets its
|
||||
own action
|
||||
"""
|
||||
first = make_workflow(admin_client, "first")
|
||||
second = make_workflow(admin_client, "second")
|
||||
foreign_action = second["actions"][0]
|
||||
foreign_email_id = foreign_action["email"]["id"]
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PUT",
|
||||
f"/api/workflows/{first['id']}/",
|
||||
workflow_body(
|
||||
"first",
|
||||
trigger={"id": first["triggers"][0]["id"]},
|
||||
action={
|
||||
"id": foreign_action["id"],
|
||||
"email": {**EMAIL, "subject": "taken over"},
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.data["actions"][0]["id"] != foreign_action["id"]
|
||||
assert WorkflowActionEmail.objects.get(pk=foreign_email_id).subject == (
|
||||
"original"
|
||||
)
|
||||
second_actions = list(
|
||||
WorkflowAction.objects.filter(workflows__pk=second["id"]),
|
||||
)
|
||||
assert [a.pk for a in second_actions] == [foreign_action["id"]]
|
||||
|
||||
def test_update_cannot_take_over_another_workflows_trigger(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Two workflows
|
||||
WHEN:
|
||||
- The first is updated with the id of the second one's trigger and a
|
||||
different filter
|
||||
THEN:
|
||||
- The second workflow's trigger is untouched
|
||||
"""
|
||||
first = make_workflow(admin_client, "first")
|
||||
second = make_workflow(admin_client, "second")
|
||||
foreign_trigger_id = second["triggers"][0]["id"]
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PUT",
|
||||
f"/api/workflows/{first['id']}/",
|
||||
workflow_body(
|
||||
"first",
|
||||
trigger={"id": foreign_trigger_id, "filter_filename": "taken"},
|
||||
action={"id": first["actions"][0]["id"]},
|
||||
),
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.data["triggers"][0]["id"] != foreign_trigger_id
|
||||
assert WorkflowTrigger.objects.get(pk=foreign_trigger_id).filter_filename != (
|
||||
"taken"
|
||||
)
|
||||
assert list(
|
||||
WorkflowTrigger.objects.filter(workflows__pk=second["id"]).values_list(
|
||||
"pk",
|
||||
flat=True,
|
||||
),
|
||||
) == [foreign_trigger_id]
|
||||
|
||||
def test_nested_email_id_of_another_action_is_ignored(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- Two workflows with email actions
|
||||
WHEN:
|
||||
- The first is updated, keeping its own action, with the second action's
|
||||
email id in the nested email
|
||||
THEN:
|
||||
- The other email is untouched and the action's own email is the one
|
||||
changed
|
||||
"""
|
||||
first = make_workflow(admin_client, "first")
|
||||
second = make_workflow(admin_client, "second")
|
||||
own_action = first["actions"][0]
|
||||
own_email_id = own_action["email"]["id"]
|
||||
foreign_email_id = second["actions"][0]["email"]["id"]
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PUT",
|
||||
f"/api/workflows/{first['id']}/",
|
||||
workflow_body(
|
||||
"first",
|
||||
trigger={"id": first["triggers"][0]["id"]},
|
||||
action={
|
||||
"id": own_action["id"],
|
||||
"email": {**EMAIL, "id": foreign_email_id, "subject": "mine"},
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert WorkflowActionEmail.objects.get(pk=foreign_email_id).subject == (
|
||||
"original"
|
||||
)
|
||||
assert response.data["actions"][0]["email"]["id"] == own_email_id
|
||||
assert WorkflowActionEmail.objects.get(pk=own_email_id).subject == "mine"
|
||||
|
||||
def test_nested_email_id_beyond_the_database_range_is_ignored(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A workflow with an email action
|
||||
WHEN:
|
||||
- It is updated with a nested email id larger than a column can hold
|
||||
THEN:
|
||||
- The request succeeds and the action keeps its own email row
|
||||
"""
|
||||
workflow = make_workflow(admin_client, "workflow")
|
||||
action = workflow["actions"][0]
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PUT",
|
||||
f"/api/workflows/{workflow['id']}/",
|
||||
workflow_body(
|
||||
"workflow",
|
||||
trigger={"id": workflow["triggers"][0]["id"]},
|
||||
action={
|
||||
"id": action["id"],
|
||||
"email": {**EMAIL, "id": 2**63},
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.data["actions"][0]["email"]["id"] == action["email"]["id"]
|
||||
|
||||
def test_create_ignores_ids_of_existing_rows(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An existing workflow
|
||||
WHEN:
|
||||
- A new workflow is created that carries that workflow's trigger and
|
||||
action ids
|
||||
THEN:
|
||||
- New rows are created and the existing ones are untouched
|
||||
"""
|
||||
existing = make_workflow(admin_client, "existing")
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"POST",
|
||||
"/api/workflows/",
|
||||
workflow_body(
|
||||
"new",
|
||||
trigger={
|
||||
"id": existing["triggers"][0]["id"],
|
||||
"filter_filename": "taken",
|
||||
},
|
||||
action={"id": existing["actions"][0]["id"]},
|
||||
),
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
assert response.data["triggers"][0]["id"] != existing["triggers"][0]["id"]
|
||||
assert response.data["actions"][0]["id"] != existing["actions"][0]["id"]
|
||||
assert WorkflowTrigger.objects.get(
|
||||
pk=existing["triggers"][0]["id"],
|
||||
).filter_filename != ("taken")
|
||||
|
||||
def test_editing_a_workflow_keeps_its_row_ids(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A workflow read back from the API, as the UI does before an edit
|
||||
WHEN:
|
||||
- It is sent back with a changed name and email subject
|
||||
THEN:
|
||||
- Its trigger, action and email keep their ids and no rows are added
|
||||
"""
|
||||
workflow = make_workflow(admin_client, "workflow")
|
||||
body = admin_client.get(f"/api/workflows/{workflow['id']}/").data
|
||||
body = json.loads(json.dumps(body))
|
||||
body["name"] = "renamed"
|
||||
body["actions"][0]["email"]["subject"] = "edited"
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PUT",
|
||||
f"/api/workflows/{workflow['id']}/",
|
||||
body,
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.data["triggers"][0]["id"] == workflow["triggers"][0]["id"]
|
||||
assert response.data["actions"][0]["id"] == workflow["actions"][0]["id"]
|
||||
assert (
|
||||
response.data["actions"][0]["email"]["id"]
|
||||
== (workflow["actions"][0]["email"]["id"])
|
||||
)
|
||||
assert response.data["actions"][0]["email"]["subject"] == "edited"
|
||||
assert WorkflowAction.objects.count() == 1
|
||||
assert WorkflowActionEmail.objects.count() == 1
|
||||
assert WorkflowTrigger.objects.count() == 1
|
||||
|
||||
def test_a_new_action_in_an_update_is_added_beside_the_existing_one(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A workflow with one action
|
||||
WHEN:
|
||||
- It is updated with that action plus a new one without an id
|
||||
THEN:
|
||||
- The first action keeps its id and a second one is created
|
||||
"""
|
||||
workflow = make_workflow(admin_client, "workflow")
|
||||
body = json.loads(
|
||||
json.dumps(admin_client.get(f"/api/workflows/{workflow['id']}/").data),
|
||||
)
|
||||
body["actions"].append({"type": 1, "assign_title": "added"})
|
||||
|
||||
response = send_json(
|
||||
admin_client,
|
||||
"PUT",
|
||||
f"/api/workflows/{workflow['id']}/",
|
||||
body,
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert len(response.data["actions"]) == 2
|
||||
assert response.data["actions"][0]["id"] == workflow["actions"][0]["id"]
|
||||
@@ -1,3 +1,5 @@
|
||||
import hashlib
|
||||
import hmac
|
||||
import pickle
|
||||
import warnings
|
||||
from datetime import UTC
|
||||
@@ -31,6 +33,7 @@ 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
|
||||
@@ -423,7 +426,7 @@ class TestClassifier(DirectoriesMixin, TestCase):
|
||||
- The ClassifierModelCorruptError is raised
|
||||
"""
|
||||
garbage_data = b"this is not valid pickle data"
|
||||
signature = DocumentClassifier._compute_hmac(garbage_data)
|
||||
signature = compute_signature(garbage_data)
|
||||
Path(settings.MODEL_FILE).write_bytes(signature + garbage_data)
|
||||
|
||||
with self.assertRaises(ClassifierModelCorruptError):
|
||||
@@ -944,9 +947,17 @@ class TestClassifierSave:
|
||||
classifier.save()
|
||||
|
||||
raw = model_file.read_bytes()
|
||||
signature = raw[: DocumentClassifier.HMAC_SIZE]
|
||||
data = raw[DocumentClassifier.HMAC_SIZE :]
|
||||
assert signature == DocumentClassifier._compute_hmac(data)
|
||||
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()
|
||||
)
|
||||
# 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] == (
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
import pytest
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from paperless_testing.factories import DocumentFactory
|
||||
from paperless_testing.factories import TagFactory
|
||||
|
||||
HUGE = 2**63 # one above the largest signed 64 bit integer
|
||||
|
||||
|
||||
class TestFilterInputBounds:
|
||||
@pytest.mark.parametrize(
|
||||
("path", "query"),
|
||||
[
|
||||
pytest.param("/api/tags/", f"id__in={HUGE}", id="tags-id-in"),
|
||||
pytest.param("/api/tags/", f"id={HUGE}", id="tags-id-exact"),
|
||||
pytest.param("/api/tags/", f"id__in=1,{HUGE}", id="tags-id-in-mixed"),
|
||||
pytest.param("/api/documents/", f"id__in={HUGE}", id="documents-id-in"),
|
||||
pytest.param("/api/documents/", "created__year=0", id="year-zero"),
|
||||
pytest.param("/api/documents/", "created__year=10000", id="year-too-big"),
|
||||
pytest.param("/api/documents/", "created__month=13", id="month-13"),
|
||||
pytest.param("/api/documents/", "created__day=0", id="day-zero"),
|
||||
pytest.param(
|
||||
"/api/documents/",
|
||||
"created__year=-10000000000000000",
|
||||
id="year-hugely-negative",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/",
|
||||
"added__gt=2024-01-01T00:00:00%2B16:29",
|
||||
id="offset-too-large",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/",
|
||||
"added__gt=0001-01-01T00:00:00%2B05:00",
|
||||
id="utc-conversion-overflows",
|
||||
),
|
||||
pytest.param("/api/share_links/", "created__year=0", id="share-links-year"),
|
||||
pytest.param(
|
||||
"/api/share_links/",
|
||||
f"expiration__day={HUGE}",
|
||||
id="share-links-day",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/share_link_bundles/",
|
||||
"expiration__year=100000000000000000",
|
||||
id="bundles-year",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/tasks/",
|
||||
"date_created_after=2024-01-01T00:00:00%2B16:29",
|
||||
id="tasks-offset",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/",
|
||||
"ordering=custom_field_abc",
|
||||
id="ordering-not-a-number",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/",
|
||||
f"ordering=custom_field_{HUGE}",
|
||||
id="ordering-out-of-range",
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_out_of_range_value_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
path: str,
|
||||
query: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- A filter or ordering value outside what the database can hold is sent
|
||||
THEN:
|
||||
- The response is a 400, not a server error
|
||||
"""
|
||||
response = admin_client.get(f"{path}?{query}")
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("path", "query"),
|
||||
[
|
||||
pytest.param("/api/documents/", f"tags__id__all={HUGE}", id="tags-all"),
|
||||
pytest.param("/api/documents/", f"tags__id__in={HUGE}", id="tags-in"),
|
||||
pytest.param(
|
||||
"/api/share_link_bundles/",
|
||||
f"documents={HUGE}",
|
||||
id="bundle-documents",
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_id_list_with_an_impossible_id_matches_nothing(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
path: str,
|
||||
query: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A document that has a tag
|
||||
WHEN:
|
||||
- An id list filter includes an id that no row can have
|
||||
THEN:
|
||||
- The request succeeds and nothing matches
|
||||
"""
|
||||
document = DocumentFactory.create()
|
||||
document.tags.add(TagFactory.create())
|
||||
|
||||
response = admin_client.get(f"{path}?{query}")
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.data["count"] == 0
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("path", "query"),
|
||||
[
|
||||
pytest.param("/api/tags/", "id__in=1,2", id="id-in"),
|
||||
pytest.param("/api/documents/", "created__year=2024", id="year"),
|
||||
pytest.param("/api/documents/", "created__year=9999", id="year-max"),
|
||||
pytest.param("/api/documents/", "created__month=12", id="month"),
|
||||
pytest.param("/api/documents/", "created__day=31", id="day"),
|
||||
pytest.param(
|
||||
"/api/documents/",
|
||||
"added__gt=2024-01-01T00:00:00%2B14:00",
|
||||
id="offset-at-the-limit",
|
||||
),
|
||||
pytest.param(
|
||||
"/api/documents/",
|
||||
"added__gt=2024-01-01T00:00:00-12:00",
|
||||
id="negative-offset",
|
||||
),
|
||||
pytest.param("/api/tasks/", "date_created_after=2024-01-01", id="tasks"),
|
||||
],
|
||||
)
|
||||
def test_in_range_values_still_work(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
path: str,
|
||||
query: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- Filters with ordinary values are sent
|
||||
THEN:
|
||||
- The request succeeds
|
||||
"""
|
||||
response = admin_client.get(f"{path}?{query}")
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
|
||||
|
||||
class TestSetPermissionsIdBounds:
|
||||
@pytest.mark.parametrize("grantee", ["users", "groups"])
|
||||
@pytest.mark.parametrize("bad_id", [HUGE, -HUGE, "abc", None])
|
||||
def test_impossible_grantee_id_is_a_400(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
grantee: str,
|
||||
bad_id: object,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A tag
|
||||
WHEN:
|
||||
- Permissions are set with a user or group id that cannot exist
|
||||
THEN:
|
||||
- The response is a 400, not a server error
|
||||
"""
|
||||
tag = TagFactory.create()
|
||||
|
||||
response = admin_client.put(
|
||||
f"/api/tags/{tag.pk}/",
|
||||
{"name": tag.name, "set_permissions": {"view": {grantee: [bad_id]}}},
|
||||
format="json",
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
@@ -434,13 +434,9 @@ class ShareLinkBundleBuildTaskTests(DirectoriesMixin, APITestCase):
|
||||
"documents.tasks.OriginalsOnlyStrategy.add_document",
|
||||
side_effect=RuntimeError("zip failure"),
|
||||
),
|
||||
mock.patch("pathlib.Path.unlink") as unlink_mock,
|
||||
self.assertRaises(RuntimeError),
|
||||
):
|
||||
unlink_mock.side_effect = [OSError("unlink"), OSError("unlink-finally")] + [
|
||||
None,
|
||||
] * 5
|
||||
with self.assertRaises(RuntimeError):
|
||||
build_share_link_bundle(bundle.pk)
|
||||
build_share_link_bundle(bundle.pk)
|
||||
|
||||
bundle.refresh_from_db()
|
||||
self.assertEqual(bundle.status, ShareLinkBundle.Status.FAILED)
|
||||
@@ -448,10 +444,6 @@ 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
|
||||
|
||||
+136
-25
@@ -3,6 +3,7 @@ import logging
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
import tempfile
|
||||
import zipfile
|
||||
from collections import Counter
|
||||
@@ -149,6 +150,7 @@ from documents.filters import StoragePathFilterSet
|
||||
from documents.filters import TagFilterSet
|
||||
from documents.filters import TitleContentFilter
|
||||
from documents.filters import WorkflowFilterSet
|
||||
from documents.filters import in_range_ids
|
||||
from documents.mail import EmailAttachment
|
||||
from documents.mail import send_email
|
||||
from documents.matching import match_correspondents
|
||||
@@ -264,6 +266,7 @@ from documents.versioning import resolve_effective_document
|
||||
from documents.versioning import resolve_requested_version_for_root
|
||||
from documents.versioning import versions_newest_first
|
||||
from paperless import version
|
||||
from paperless.api_parsers import ObjectJSONParser
|
||||
from paperless.celery import app as celery_app
|
||||
from paperless.config import AIConfig
|
||||
from paperless.config import GeneralConfig
|
||||
@@ -942,7 +945,7 @@ class EmailDocumentDetailSchema(EmailSerializer):
|
||||
parameters=[
|
||||
OpenApiParameter(
|
||||
name="id",
|
||||
type=OpenApiTypes.STR,
|
||||
type=OpenApiTypes.INT,
|
||||
location=OpenApiParameter.PATH,
|
||||
),
|
||||
],
|
||||
@@ -1036,6 +1039,14 @@ 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],
|
||||
@@ -2109,8 +2120,9 @@ class DocumentViewSet(
|
||||
)
|
||||
# TODO: deprecated, remove with drop of support for API v9
|
||||
def email_document(self, request, pk=None):
|
||||
request_data = request.data.copy()
|
||||
request_data.setlist("documents", [pk])
|
||||
# A JSON body is a plain dict and a form body a QueryDict, copy into a dict
|
||||
request_data = dict(request.data.items())
|
||||
request_data["documents"] = [pk]
|
||||
return self.email_documents(request, data=request_data)
|
||||
|
||||
@action(
|
||||
@@ -2205,7 +2217,7 @@ class DocumentViewSet(
|
||||
raise Http404
|
||||
|
||||
try:
|
||||
doc_name, doc_data = serializer.validated_data.get("document")
|
||||
doc_name, doc_file = serializer.validated_data.get("document")
|
||||
version_label = serializer.validated_data.get("version_label")
|
||||
|
||||
t = int(mktime(datetime.now().timetuple()))
|
||||
@@ -2216,7 +2228,9 @@ class DocumentViewSet(
|
||||
pathvalidate.sanitize_filename(doc_name),
|
||||
)
|
||||
|
||||
temp_file_path.write_bytes(doc_data)
|
||||
with temp_file_path.open("wb") as scratch_file:
|
||||
for chunk in doc_file.chunks():
|
||||
scratch_file.write(chunk)
|
||||
|
||||
os.utime(temp_file_path, times=(t, t))
|
||||
|
||||
@@ -2884,6 +2898,13 @@ 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",
|
||||
@@ -2901,6 +2922,7 @@ class UnifiedSearchViewSet(DocumentViewSet):
|
||||
name="id",
|
||||
type=OpenApiTypes.STR,
|
||||
location=OpenApiParameter.PATH,
|
||||
enum=list(LOG_FILES),
|
||||
),
|
||||
OpenApiParameter(
|
||||
name="limit",
|
||||
@@ -2921,11 +2943,7 @@ class UnifiedSearchViewSet(DocumentViewSet):
|
||||
class LogViewSet(ViewSet):
|
||||
permission_classes = (IsAuthenticated, PaperlessAdminPermissions)
|
||||
|
||||
ALLOWED_LOG_FILES = {
|
||||
"paperless": "paperless.log",
|
||||
"mail": "mail.log",
|
||||
"celery": "celery.log",
|
||||
}
|
||||
ALLOWED_LOG_FILES = LOG_FILES
|
||||
|
||||
def get_log_file(self, log_key: str) -> Path:
|
||||
return Path(settings.LOGGING_DIR) / self.ALLOWED_LOG_FILES[log_key]
|
||||
@@ -2948,6 +2966,8 @@ class LogViewSet(ViewSet):
|
||||
raise ValidationError({"limit": "Must be a positive integer"})
|
||||
if limit < 1:
|
||||
raise ValidationError({"limit": "Must be a positive integer"})
|
||||
# A limit past what a deque can hold is the same as no limit at all
|
||||
limit = min(limit, sys.maxsize)
|
||||
else:
|
||||
limit = None
|
||||
|
||||
@@ -3118,7 +3138,7 @@ def queue_bulk_operation(
|
||||
|
||||
class DocumentOperationPermissionMixin(PassUserMixin, DocumentSelectionMixin):
|
||||
permission_classes = (IsAuthenticated,)
|
||||
parser_classes = (parsers.JSONParser,)
|
||||
parser_classes = (ObjectJSONParser,)
|
||||
|
||||
def _queue_bulk_operation(self, method, documents, parameters, from_webui):
|
||||
return queue_bulk_operation(
|
||||
@@ -3498,7 +3518,7 @@ class PostDocumentView(GenericAPIView[Any]):
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
doc_name, doc_data = serializer.validated_data.get("document")
|
||||
doc_name, doc_file = 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")
|
||||
@@ -3518,7 +3538,9 @@ class PostDocumentView(GenericAPIView[Any]):
|
||||
pathvalidate.sanitize_filename(doc_name),
|
||||
)
|
||||
|
||||
temp_file_path.write_bytes(doc_data)
|
||||
with temp_file_path.open("wb") as scratch_file:
|
||||
for chunk in doc_file.chunks():
|
||||
scratch_file.write(chunk)
|
||||
|
||||
os.utime(temp_file_path, times=(t, t))
|
||||
|
||||
@@ -3618,7 +3640,7 @@ class PostDocumentView(GenericAPIView[Any]):
|
||||
class SelectionDataView(DocumentSelectionMixin, GenericAPIView[Any]):
|
||||
permission_classes = (IsAuthenticated, ViewDocumentsPermissions)
|
||||
serializer_class = DocumentSelectionSerializer
|
||||
parser_classes = (parsers.MultiPartParser, parsers.JSONParser)
|
||||
parser_classes = (parsers.MultiPartParser, ObjectJSONParser)
|
||||
|
||||
def post(self, request, format=None):
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
@@ -3733,7 +3755,10 @@ class SearchAutoCompleteView(GenericAPIView[Any]):
|
||||
return HttpResponseBadRequest("Term required")
|
||||
|
||||
if "limit" in request.query_params:
|
||||
limit = int(request.query_params["limit"])
|
||||
try:
|
||||
limit = int(request.query_params["limit"])
|
||||
except ValueError:
|
||||
return HttpResponseBadRequest("Invalid limit")
|
||||
if limit <= 0:
|
||||
return HttpResponseBadRequest("Invalid limit")
|
||||
else:
|
||||
@@ -3800,6 +3825,9 @@ class GlobalSearchView(PassUserMixin):
|
||||
return HttpResponseBadRequest(
|
||||
f"Query must be at most {_MAX_QUERY_LENGTH} characters",
|
||||
)
|
||||
if "\x00" in query:
|
||||
# Postgres cannot store or compare text containing a null byte
|
||||
return HttpResponseBadRequest("Query must not contain null characters")
|
||||
|
||||
db_only = request.query_params.get("db_only", False)
|
||||
|
||||
@@ -4009,7 +4037,36 @@ class GlobalSearchView(PassUserMixin):
|
||||
get=extend_schema(
|
||||
description="Get statistics for the current user",
|
||||
responses={
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
(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(),
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
)
|
||||
@@ -4124,7 +4181,7 @@ class StatisticsView(GenericAPIView[Any]):
|
||||
class BulkDownloadView(DocumentSelectionMixin, GenericAPIView[Any]):
|
||||
permission_classes = (IsAuthenticated, ViewDocumentsPermissions)
|
||||
serializer_class = BulkDownloadSerializer
|
||||
parser_classes = (parsers.JSONParser,)
|
||||
parser_classes = (ObjectJSONParser,)
|
||||
|
||||
def post(self, request, format=None):
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
@@ -4274,8 +4331,10 @@ class UiSettingsView(GenericAPIView[Any]):
|
||||
user = User.objects.select_related("ui_settings").get(pk=request.user.id)
|
||||
ui_settings = {}
|
||||
if hasattr(user, "ui_settings"):
|
||||
ui_settings = user.ui_settings.settings
|
||||
if "update_checking" in ui_settings:
|
||||
# Saved as null or, before it was validated, as something else
|
||||
stored = user.ui_settings.settings
|
||||
ui_settings = stored if isinstance(stored, dict) else {}
|
||||
if isinstance(ui_settings.get("update_checking"), dict):
|
||||
ui_settings["update_checking"]["backend_setting"] = (
|
||||
settings.ENABLE_UPDATE_CHECK
|
||||
)
|
||||
@@ -4494,7 +4553,13 @@ def get_github_stars() -> int | None:
|
||||
get=extend_schema(
|
||||
description="Get the current version of the Paperless-NGX server",
|
||||
responses={
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
(200, "application/json"): inline_serializer(
|
||||
name="RemoteVersion",
|
||||
fields={
|
||||
"version": serializers.CharField(),
|
||||
"update_available": serializers.BooleanField(),
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
)
|
||||
@@ -4559,7 +4624,17 @@ class RemoteVersionView(GenericAPIView[Any]):
|
||||
),
|
||||
],
|
||||
responses={
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
(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),
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
)
|
||||
@@ -4989,9 +5064,9 @@ class ShareLinkBundleViewSet(PassUserMixin, ModelViewSet[ShareLinkBundle]):
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
document_ids = serializer.validated_data["document_ids"]
|
||||
documents_qs = Document.objects.filter(pk__in=document_ids).select_related(
|
||||
"owner",
|
||||
)
|
||||
documents_qs = Document.objects.filter(
|
||||
pk__in=in_range_ids(document_ids),
|
||||
).select_related("owner")
|
||||
found_ids = set(documents_qs.values_list("pk", flat=True))
|
||||
missing = sorted(set(document_ids) - found_ids)
|
||||
if missing:
|
||||
@@ -5243,7 +5318,7 @@ def serve_file(
|
||||
class BulkEditObjectsView(PassUserMixin):
|
||||
permission_classes = (IsAuthenticated,)
|
||||
serializer_class = BulkEditObjectsSerializer
|
||||
parser_classes = (parsers.JSONParser,)
|
||||
parser_classes = (ObjectJSONParser,)
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
@@ -5823,6 +5898,26 @@ 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
|
||||
@@ -5971,6 +6066,22 @@ 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-27 02:54+0000\n"
|
||||
"POT-Creation-Date: 2026-11-28 23:01+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: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
|
||||
#: documents/serialisers.py:495 documents/serialisers.py:819
|
||||
#: documents/serialisers.py:2918 documents/views.py:372 documents/views.py:638
|
||||
#: documents/views.py:2870 paperless_mail/serialisers.py:145
|
||||
msgid "Insufficient permissions."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:647
|
||||
#: documents/serialisers.py:651
|
||||
msgid "Invalid color."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2380
|
||||
#: documents/serialisers.py:2385
|
||||
#, python-format
|
||||
msgid "File type %(type)s not supported"
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2424
|
||||
#: documents/serialisers.py:2429
|
||||
#, python-format
|
||||
msgid "Custom field id must be an integer: %(id)s"
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2431
|
||||
#: documents/serialisers.py:2436
|
||||
#, python-format
|
||||
msgid "Custom field with id %(id)s does not exist"
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2448 documents/serialisers.py:2458
|
||||
#: documents/serialisers.py:2453 documents/serialisers.py:2463
|
||||
msgid ""
|
||||
"Custom fields must be a list of integers or an object mapping ids to values."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2453
|
||||
#: documents/serialisers.py:2458
|
||||
msgid "Some custom fields don't exist or were specified twice."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2600
|
||||
#: documents/serialisers.py:2605
|
||||
msgid "Invalid variable detected."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2969
|
||||
#: documents/serialisers.py:2974
|
||||
msgid "Duplicate document identifiers are not allowed."
|
||||
msgstr ""
|
||||
|
||||
#: documents/serialisers.py:2999 documents/views.py:5001
|
||||
#: documents/serialisers.py:3004 documents/views.py:5008
|
||||
#, python-format
|
||||
msgid "Documents not found: %(ids)s"
|
||||
msgstr ""
|
||||
@@ -2192,7 +2192,7 @@ msgstr ""
|
||||
msgid "Specify only one of text, title_search, query, or more_like_id."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:365 documents/views.py:2865
|
||||
#: documents/views.py:365 documents/views.py:2867
|
||||
msgid "Invalid more_like_id"
|
||||
msgstr ""
|
||||
|
||||
@@ -2208,20 +2208,20 @@ msgstr ""
|
||||
msgid "AI backend rejected the request. Check logs for details."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:5017
|
||||
#: documents/views.py:5024
|
||||
#, python-format
|
||||
msgid "Insufficient permissions to share document %(id)s."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:5064
|
||||
#: documents/views.py:5071
|
||||
msgid "Bundle is already being processed."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:5130
|
||||
#: documents/views.py:5137
|
||||
msgid "The share link bundle is still being prepared. Please try again later."
|
||||
msgstr ""
|
||||
|
||||
#: documents/views.py:5144
|
||||
#: documents/views.py:5151
|
||||
msgid "The share link bundle is unavailable."
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
from rest_framework.exceptions import ParseError
|
||||
from rest_framework.parsers import JSONParser
|
||||
|
||||
|
||||
class ObjectJSONParser(JSONParser):
|
||||
"""
|
||||
DRF accepts any JSON document as a request body. The views and serializers here
|
||||
read the body as a mapping, so a top level list or scalar (or null) would end in
|
||||
a server error. Reject it as the malformed request it is.
|
||||
"""
|
||||
|
||||
def parse(self, stream, media_type=None, parser_context=None):
|
||||
data = super().parse(stream, media_type, parser_context)
|
||||
if not isinstance(data, dict):
|
||||
raise ParseError("The request body must be a JSON object.")
|
||||
return data
|
||||
@@ -20,4 +20,6 @@ class ObfuscatedPasswordField(serializers.CharField):
|
||||
return OBFUSCATED_PASSWORD_MASK
|
||||
|
||||
def to_internal_value(self, data):
|
||||
if not isinstance(data, str):
|
||||
self.fail("invalid")
|
||||
return data
|
||||
@@ -364,13 +364,14 @@ def extract_pdf_metadata(
|
||||
namespace_pattern = re.compile(r"\{(.*)\}(.*)")
|
||||
|
||||
try:
|
||||
pdf = pikepdf.open(document_path)
|
||||
meta = pdf.open_metadata()
|
||||
with pikepdf.open(document_path) as pdf:
|
||||
meta = pdf.open_metadata()
|
||||
items = list(meta.items())
|
||||
except Exception as e:
|
||||
_log.warning("Could not open PDF metadata for %s: %s", document_path, e)
|
||||
return []
|
||||
|
||||
for key, value in meta.items():
|
||||
for key, value in items:
|
||||
if isinstance(value, list):
|
||||
value = " ".join(str(e) for e in value)
|
||||
value = str(value)
|
||||
|
||||
@@ -15,6 +15,7 @@ from django.contrib.auth.models import User
|
||||
from django.contrib.auth.password_validation import validate_password
|
||||
from django.core.files.uploadedfile import InMemoryUploadedFile
|
||||
from django.core.files.uploadedfile import UploadedFile
|
||||
from django.http import QueryDict
|
||||
from PIL import Image
|
||||
from rest_framework import serializers
|
||||
from rest_framework.authtoken.serializers import AuthTokenSerializer
|
||||
@@ -77,9 +78,21 @@ class PaperlessAuthTokenSerializer(AuthTokenSerializer):
|
||||
return attrs
|
||||
|
||||
|
||||
class CodenameRelatedField(serializers.SlugRelatedField):
|
||||
"""
|
||||
Looks a permission up by its codename. A codename with a null byte cannot exist, and
|
||||
Postgres raises an error, instead of finding nothing, if asked for one.
|
||||
"""
|
||||
|
||||
def to_internal_value(self, data):
|
||||
if isinstance(data, str) and "\x00" in data:
|
||||
self.fail("does_not_exist", slug_name=self.slug_field, value=repr(data))
|
||||
return super().to_internal_value(data)
|
||||
|
||||
|
||||
class UserSerializer(PasswordValidationMixin, serializers.ModelSerializer[User]):
|
||||
password = ObfuscatedPasswordField(required=False)
|
||||
user_permissions = serializers.SlugRelatedField(
|
||||
user_permissions = CodenameRelatedField(
|
||||
many=True,
|
||||
queryset=Permission.objects.exclude(content_type__app_label="admin"),
|
||||
slug_field="codename",
|
||||
@@ -146,7 +159,7 @@ class UserSerializer(PasswordValidationMixin, serializers.ModelSerializer[User])
|
||||
|
||||
|
||||
class GroupSerializer(serializers.ModelSerializer[Group]):
|
||||
permissions = serializers.SlugRelatedField(
|
||||
permissions = CodenameRelatedField(
|
||||
many=True,
|
||||
queryset=Permission.objects.exclude(content_type__app_label="admin"),
|
||||
slug_field="codename",
|
||||
@@ -272,6 +285,9 @@ class ApplicationConfigurationSerializer(
|
||||
return value
|
||||
|
||||
def run_validation(self, data):
|
||||
# A form encoded body arrives as an immutable QueryDict
|
||||
if isinstance(data, QueryDict) and not data._mutable:
|
||||
data = data.copy()
|
||||
# Empty strings treated as None to avoid unexpected behavior
|
||||
if "user_args" in data and data["user_args"] == "":
|
||||
data["user_args"] = None
|
||||
@@ -282,7 +298,8 @@ class ApplicationConfigurationSerializer(
|
||||
if "llm_output_language" in data and data["llm_output_language"] == "":
|
||||
data["llm_output_language"] = None
|
||||
for field in self.OBFUSCATED_FIELDS:
|
||||
if field in data and data[field] is not None:
|
||||
# Anything that is not a string is left for the field to reject
|
||||
if field in data and isinstance(data[field], str):
|
||||
if data[field] == "":
|
||||
data[field] = None
|
||||
# Not a real value, don't overwrite the stored one
|
||||
@@ -365,3 +382,8 @@ class ApplicationConfigurationSerializer(
|
||||
class Meta:
|
||||
model = ApplicationConfiguration
|
||||
fields = "__all__"
|
||||
|
||||
|
||||
class TOTPActivationSerializer(serializers.Serializer[dict[str, str]]):
|
||||
secret = serializers.CharField()
|
||||
code = serializers.CharField()
|
||||
@@ -169,6 +169,11 @@ REST_FRAMEWORK = {
|
||||
"rest_framework.authentication.TokenAuthentication",
|
||||
"rest_framework.authentication.SessionAuthentication",
|
||||
],
|
||||
"DEFAULT_PARSER_CLASSES": [
|
||||
"paperless.api_parsers.ObjectJSONParser",
|
||||
"rest_framework.parsers.FormParser",
|
||||
"rest_framework.parsers.MultiPartParser",
|
||||
],
|
||||
"DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.AcceptHeaderVersioning",
|
||||
"DEFAULT_VERSION": "10", # match src-ui/src/environments/environment.prod.ts
|
||||
# Make sure these are ordered and that the most recent version appears
|
||||
|
||||
@@ -3,10 +3,17 @@ 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
|
||||
|
||||
|
||||
@@ -14,26 +21,91 @@ class SignedPickleError(ValueError):
|
||||
"""Raised when a signed pickle payload cannot be authenticated."""
|
||||
|
||||
|
||||
def _get_signing_key() -> bytes:
|
||||
return settings.SECRET_KEY.encode()
|
||||
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 signed_pickle_dumps(obj: object) -> bytes:
|
||||
data = pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
|
||||
signature = hmac.new(_get_signing_key(), data, sha256).digest()
|
||||
return signature + data
|
||||
def compute_signature(data: bytes | memoryview) -> bytes:
|
||||
mac = new_mac()
|
||||
mac.update(data)
|
||||
return mac.digest()
|
||||
|
||||
|
||||
def signed_pickle_loads(payload: bytes) -> Any:
|
||||
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)
|
||||
|
||||
signature = payload[:HMAC_SIZE]
|
||||
data = payload[HMAC_SIZE:]
|
||||
expected = hmac.new(_get_signing_key(), data, sha256).digest()
|
||||
if not hmac.compare_digest(signature, expected):
|
||||
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 pickle.loads(data)
|
||||
return data
|
||||
|
||||
|
||||
def signed_pickle_dumps(obj: object) -> bytes:
|
||||
data = pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
|
||||
return compute_signature(data) + data
|
||||
|
||||
|
||||
def signed_pickle_loads(payload: bytes) -> Any:
|
||||
return pickle.loads(verify_signed(payload))
|
||||
|
||||
|
||||
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)
|
||||
@@ -0,0 +1,122 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from pytest_django.fixtures import DjangoAssertNumQueries
|
||||
from pytest_django.fixtures import Settings
|
||||
from rest_framework import status
|
||||
from rest_framework.exceptions import ValidationError
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
from paperless.serialisers import GroupSerializer
|
||||
from paperless.serialisers import UserSerializer
|
||||
|
||||
|
||||
class TestNullByteInput:
|
||||
@pytest.mark.parametrize("db_only", ["true", "false"])
|
||||
def test_global_search_rejects_null_byte(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
db_only: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- An authenticated client
|
||||
WHEN:
|
||||
- The global search query contains a null byte
|
||||
THEN:
|
||||
- The response is a 400, the query never reaches the database
|
||||
"""
|
||||
response = admin_client.get(
|
||||
"/api/search/",
|
||||
{"query": "invoice\x00number", "db_only": db_only},
|
||||
)
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("serializer", "field"),
|
||||
[
|
||||
pytest.param(GroupSerializer, "permissions", id="group"),
|
||||
pytest.param(UserSerializer, "user_permissions", id="user"),
|
||||
],
|
||||
)
|
||||
def test_codename_with_null_byte_is_rejected_without_a_query(
|
||||
self,
|
||||
db: None,
|
||||
django_assert_num_queries: DjangoAssertNumQueries,
|
||||
serializer: type,
|
||||
field: str,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A permission codename field
|
||||
WHEN:
|
||||
- A value containing a null byte is validated
|
||||
THEN:
|
||||
- It is rejected without querying, Postgres raises an error for it
|
||||
where SQLite does not
|
||||
"""
|
||||
codename_field = serializer().fields[field].child_relation
|
||||
|
||||
with django_assert_num_queries(0), pytest.raises(ValidationError):
|
||||
codename_field.to_internal_value("view_document\x00")
|
||||
|
||||
|
||||
class TestLogLimit:
|
||||
def test_limit_larger_than_any_file_returns_everything(
|
||||
self,
|
||||
admin_client: APIClient,
|
||||
settings: Settings,
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
- A log file
|
||||
WHEN:
|
||||
- The limit is larger than a platform integer can hold
|
||||
THEN:
|
||||
- The whole file is returned, as for any limit above its length
|
||||
"""
|
||||
settings.LOGGING_DIR = tmp_path
|
||||
(tmp_path / "paperless.log").write_text("one\ntwo\nthree\n")
|
||||
|
||||
response = admin_client.get("/api/logs/paperless/", {"limit": 2**70})
|
||||
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.data == ["one", "two", "three"]
|
||||
|
||||
|
||||
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,
|
||||
) -> 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
|
||||
@@ -0,0 +1,95 @@
|
||||
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")
|
||||
@@ -12,6 +12,8 @@ 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:
|
||||
@@ -80,6 +82,14 @@ 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"):
|
||||
|
||||
@@ -12,6 +12,11 @@ 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"],
|
||||
@@ -49,6 +54,19 @@ 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,6 +57,7 @@ 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
|
||||
@@ -309,6 +310,8 @@ 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,19 +2,18 @@ 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 = {
|
||||
"""
|
||||
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:
|
||||
# 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:
|
||||
# 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
|
||||
@@ -22,7 +21,6 @@ OCR_TO_DATEPARSER_LANGUAGES = {
|
||||
"amh": "am",
|
||||
"ara": "ar",
|
||||
"asm": "as",
|
||||
"ast": "ast",
|
||||
"aze": "az",
|
||||
"bel": "be",
|
||||
"bul": "bg",
|
||||
@@ -31,7 +29,7 @@ OCR_TO_DATEPARSER_LANGUAGES = {
|
||||
"bre": "br",
|
||||
"bos": "bs",
|
||||
"cat": "ca",
|
||||
"cher": "chr",
|
||||
"chr": "chr",
|
||||
"ces": "cs",
|
||||
"cym": "cy",
|
||||
"dan": "da",
|
||||
@@ -65,19 +63,21 @@ OCR_TO_DATEPARSER_LANGUAGES = {
|
||||
"kat": "ka",
|
||||
"kaz": "kk",
|
||||
"khm": "km",
|
||||
"knda": "kn",
|
||||
"kan": "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",
|
||||
"via": "vi",
|
||||
"vie": "vi", # codespell:ignore
|
||||
"yid": "yi",
|
||||
"yor": "yo",
|
||||
"chi": "zh",
|
||||
|
||||
+64
-8
@@ -24,17 +24,22 @@ 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
|
||||
from rest_framework.generics import GenericAPIView
|
||||
from rest_framework.generics import get_object_or_404
|
||||
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
|
||||
@@ -49,6 +54,7 @@ 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
|
||||
|
||||
|
||||
@@ -212,11 +218,17 @@ class UserViewSet(ModelViewSet[User]):
|
||||
@action(detail=True, methods=["post"])
|
||||
def deactivate_totp(self, request, pk=None):
|
||||
request_user = request.user
|
||||
user = User.objects.get(pk=pk)
|
||||
if not request_user.is_superuser and request_user != user:
|
||||
# Decide on permission before looking the user up, so the response does not
|
||||
# reveal whether another user's id exists
|
||||
try:
|
||||
is_self = int(pk) == request_user.pk
|
||||
except (TypeError, ValueError):
|
||||
is_self = False
|
||||
if not request_user.is_superuser and not is_self:
|
||||
return HttpResponseForbidden(
|
||||
"You do not have permission to deactivate TOTP for this user",
|
||||
)
|
||||
user = get_object_or_404(User, pk=pk)
|
||||
authenticator = Authenticator.objects.filter(
|
||||
user=user,
|
||||
type=Authenticator.Type.TOTP,
|
||||
@@ -274,8 +286,16 @@ 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"): OpenApiTypes.OBJECT,
|
||||
(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(),
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
post=extend_schema(
|
||||
@@ -290,7 +310,17 @@ class ProfileView(GenericAPIView[Any]):
|
||||
},
|
||||
},
|
||||
responses={
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
(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",
|
||||
),
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
delete=extend_schema(
|
||||
@@ -306,6 +336,7 @@ class TOTPView(GenericAPIView[Any]):
|
||||
"""
|
||||
|
||||
permission_classes = [IsAuthenticated]
|
||||
serializer_class = TOTPActivationSerializer
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
"""
|
||||
@@ -328,15 +359,18 @@ 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(
|
||||
request.data["secret"],
|
||||
request.data["code"],
|
||||
secret,
|
||||
serializer.validated_data["code"],
|
||||
)
|
||||
recovery_codes = None
|
||||
if valid:
|
||||
auth = totp_auth.TOTP.activate(
|
||||
request.user,
|
||||
request.data["secret"],
|
||||
secret,
|
||||
).instance
|
||||
signals.authenticator_added.send(
|
||||
sender=Authenticator,
|
||||
@@ -523,7 +557,14 @@ class DisconnectSocialAccountView(GenericAPIView[Any]):
|
||||
@extend_schema_view(
|
||||
get=extend_schema(
|
||||
responses={
|
||||
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||
(200, "application/json"): inline_serializer(
|
||||
name="SocialAccountProvider",
|
||||
fields={
|
||||
"name": serializers.CharField(),
|
||||
"login_url": serializers.CharField(),
|
||||
},
|
||||
many=True,
|
||||
),
|
||||
},
|
||||
),
|
||||
)
|
||||
@@ -557,3 +598,18 @@ 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
|
||||
@@ -2,6 +2,7 @@ import datetime
|
||||
import imaplib
|
||||
import itertools
|
||||
import logging
|
||||
import os
|
||||
import socket
|
||||
import ssl
|
||||
import tempfile
|
||||
@@ -1135,12 +1136,12 @@ class MailAccountHandler(LoggingMixin):
|
||||
doc_type,
|
||||
):
|
||||
settings.SCRATCH_DIR.mkdir(parents=True, exist_ok=True)
|
||||
_, temp_filename = tempfile.mkstemp(
|
||||
fd, temp_filename = tempfile.mkstemp(
|
||||
prefix="paperless-mail-",
|
||||
dir=settings.SCRATCH_DIR,
|
||||
suffix=".eml",
|
||||
)
|
||||
with Path(temp_filename).open("wb") as f:
|
||||
with os.fdopen(fd, "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
|
||||
|
||||
@@ -2,6 +2,8 @@ from django.utils.translation import gettext as _
|
||||
from rest_framework import serializers
|
||||
from rest_framework.exceptions import PermissionDenied
|
||||
|
||||
from documents.filters import INT16_MAX
|
||||
from documents.filters import INT16_MIN
|
||||
from documents.permissions import has_perms_owner_aware
|
||||
from documents.permissions import restrict_queryset_to_visible
|
||||
from documents.serialisers import CorrespondentField
|
||||
@@ -17,7 +19,12 @@ from paperless_mail.models import ProcessedMail
|
||||
|
||||
class MailAccountSerializer(OwnedObjectSerializer):
|
||||
password = ObfuscatedPasswordField()
|
||||
imap_port = serializers.IntegerField(required=True, allow_null=False)
|
||||
imap_port = serializers.IntegerField(
|
||||
required=True,
|
||||
allow_null=False,
|
||||
min_value=1,
|
||||
max_value=65535,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = MailAccount
|
||||
@@ -39,6 +46,21 @@ class MailAccountSerializer(OwnedObjectSerializer):
|
||||
"expiration",
|
||||
]
|
||||
|
||||
def validate(self, attrs):
|
||||
attrs = super().validate(attrs)
|
||||
# On an update the other half of the pair is the stored one
|
||||
security = attrs.get(
|
||||
"imap_security",
|
||||
getattr(self.instance, "imap_security", None),
|
||||
)
|
||||
port = attrs.get("imap_port", getattr(self.instance, "imap_port", None))
|
||||
if security == MailAccount.ImapSecurity.STARTTLS and port == 993:
|
||||
# Connecting would fail every time, port 993 speaks SSL from the start
|
||||
raise serializers.ValidationError(
|
||||
{"imap_port": "Port 993 requires SSL, it cannot be used with STARTTLS"},
|
||||
)
|
||||
return attrs
|
||||
|
||||
def update(self, instance, validated_data):
|
||||
if "password" in validated_data and is_obfuscated_password(
|
||||
validated_data["password"],
|
||||
@@ -70,11 +92,16 @@ class MailRuleSerializer(OwnedObjectSerializer):
|
||||
allow_null=True,
|
||||
required=False,
|
||||
default="",
|
||||
max_length=256,
|
||||
)
|
||||
assign_correspondent = CorrespondentField(allow_null=True, required=False)
|
||||
assign_tags = TagsField(many=True, allow_null=True, required=False)
|
||||
assign_document_type = DocumentTypeField(allow_null=True, required=False)
|
||||
order = serializers.IntegerField(required=False)
|
||||
order = serializers.IntegerField(
|
||||
required=False,
|
||||
min_value=INT16_MIN,
|
||||
max_value=INT16_MAX,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = MailRule
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import datetime
|
||||
import imaplib
|
||||
import logging
|
||||
from datetime import timedelta
|
||||
from http import HTTPStatus
|
||||
@@ -10,6 +11,7 @@ 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
|
||||
@@ -98,8 +100,11 @@ class MailAccountViewSet(PassUserMixin, ModelViewSet[MailAccount]):
|
||||
@action(methods=["post"], detail=False)
|
||||
def test(self, request):
|
||||
logger = logging.getLogger("paperless_mail")
|
||||
request.data["name"] = datetime.datetime.now().isoformat()
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
# request.data is read only for a form encoded body, and QueryDict.copy would
|
||||
# deep copy any uploaded file, so build a plain dict
|
||||
data = dict(request.data.items())
|
||||
data["name"] = datetime.datetime.now().isoformat()
|
||||
serializer = self.get_serializer(data=data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
existing_account = None
|
||||
account_id = request.data.get("id")
|
||||
@@ -135,7 +140,15 @@ class MailAccountViewSet(PassUserMixin, ModelViewSet[MailAccount]):
|
||||
serializer.validated_data["refresh_token"] = existing_account.refresh_token
|
||||
serializer.validated_data["expiration"] = existing_account.expiration
|
||||
|
||||
account = MailAccount(**serializer.validated_data)
|
||||
# The serializer also carries write only fields that are not model fields
|
||||
model_fields = {field.name for field in MailAccount._meta.concrete_fields}
|
||||
account = MailAccount(
|
||||
**{
|
||||
key: value
|
||||
for key, value in serializer.validated_data.items()
|
||||
if key in model_fields
|
||||
},
|
||||
)
|
||||
try:
|
||||
with get_mailbox(
|
||||
account.imap_server,
|
||||
@@ -161,9 +174,11 @@ class MailAccountViewSet(PassUserMixin, ModelViewSet[MailAccount]):
|
||||
|
||||
mailbox_login(M, account)
|
||||
return Response({"success": True})
|
||||
except MailError:
|
||||
except (MailError, OSError, imaplib.IMAP4.error, UnicodeError) as exc:
|
||||
# A refused connection, an unknown host, a timeout, a TLS failure or a bad
|
||||
# host name is exactly what this endpoint exists to report
|
||||
logger.error(
|
||||
"Mail account connectivity test failed",
|
||||
f"Mail account connectivity test failed: {type(exc).__name__}: {exc}",
|
||||
)
|
||||
return HttpResponseBadRequest("Unable to connect to server")
|
||||
|
||||
@@ -254,8 +269,39 @@ class MailRuleViewSet(PassUserMixin, ModelViewSet[MailRule]):
|
||||
|
||||
@extend_schema_view(
|
||||
get=extend_schema(
|
||||
description="Callback view for OAuth2 authentication",
|
||||
responses={200: None},
|
||||
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,
|
||||
},
|
||||
),
|
||||
)
|
||||
class OauthCallbackView(GenericAPIView[Any]):
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from django.http import HttpResponse
|
||||
from django.http import StreamingHttpResponse
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
|
||||
def read_streaming_response(response: StreamingHttpResponse) -> bytes:
|
||||
@@ -11,3 +14,13 @@ def read_streaming_response(response: StreamingHttpResponse) -> bytes:
|
||||
content = b"".join(response.streaming_content)
|
||||
response.close()
|
||||
return content
|
||||
|
||||
|
||||
def send_json(client: APIClient, method: str, path: str, body: object) -> HttpResponse:
|
||||
"""Send a request with a JSON body, any method, whatever the body is."""
|
||||
return client.generic(
|
||||
method,
|
||||
path,
|
||||
data=json.dumps(body),
|
||||
content_type="application/json",
|
||||
)
|
||||
@@ -177,27 +177,27 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "ast-serialize"
|
||||
version = "0.13.1"
|
||||
version = "0.11.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/21/d5/5dc1ee8a80c3b20a0b63c61b43ba6bc53517faecd1def47bcd752d22268e/ast_serialize-0.13.1.tar.gz", hash = "sha256:401cc84e8888d4d76f2c8d296fa006ed1a5ff993b6aff90dd777c03973efd025", size = 955137, upload-time = "2026-10-17T00:04:17.183Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/54/1e/4f6082cdd6e5a29093513e9a3eabc5ed1c5331a9a84386b2fece80a00a48/ast_serialize-0.11.2.tar.gz", hash = "sha256:976a5bd75845d22f4b52905ddf53ab669ef1b14dba7735f5512841a2ef2b5450", size = 954387, upload-time = "2026-09-13T18:48:55.673Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f3/a8/fbd136b9f70c59e75f59a8e974c84102976f1201828b4f886480ba956936/ast_serialize-0.13.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:3e129d44b0cffbea24a7f40117ce49e30993c3d119e584d4817ebd6f87246456", size = 897306, upload-time = "2026-10-17T00:02:52.479Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c0/5c/8e959db5cc2237f9d4c560a8e2253c98f9746883fb4774651e4cda458901/ast_serialize-0.13.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:638333fb8ae72c62753f9e794fda20290883ddc65b0d85e26e08f8bb227567ad", size = 1221242, upload-time = "2026-10-17T00:02:56.395Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d6/05/ab1c56c3b7adcac88764bba609502d6b4989e449b2dd60eb478e1d20e369/ast_serialize-0.13.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc34c670747d85d4232834665e247009413eaebe47c69eaf60a5c439aaecaed9", size = 1282105, upload-time = "2026-10-17T00:02:58.275Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/06/dd/7c623d2fb0b868948952d1787e629a43b866f7d4caefd5445e20aefacec4/ast_serialize-0.13.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f3e8a3eff69af640db985360fef35073fb46956dfc3e5c614cf00920d2746dd", size = 1302773, upload-time = "2026-10-17T00:03:04.378Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/9c/2266794e6c25fa9ce51ce04a9bf4b7e330e3ac9351ba3fa14e487678acdb/ast_serialize-0.13.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:9221e09496fb942901993c1812ee87950cc0ecbb514c7c0f1f5fa6d78f701ed8", size = 1460227, upload-time = "2026-10-17T00:03:08.733Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1d/87/6e8ac4a865124a12cc4f915bf1bcfac3bba426cd5f58d3712a873ee61012/ast_serialize-0.13.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f8b17e2921e56621bcb46792bd3e0b82ca3b85de78d5936e7b8174ba1758b0aa", size = 1500566, upload-time = "2026-10-17T00:03:15.917Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/23/c4/a8a2ca21e3943555b48221f8fba546877a7ad39efaf6505506524967d7c4/ast_serialize-0.13.1-cp315-abi3.abi3t-macosx_11_0_arm64.whl", hash = "sha256:68f8829d114dab6c9db4a8bbb8d0e342958faee1b5e15a29022678df639960f8", size = 1222214, upload-time = "2026-10-17T00:03:23.462Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/15/19/2f58f2ba64e4799b39de85c140aef09a03aa6ea53be75dd292a9d9b9d8ae/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e385b17d5bde892a6184003a9aff3518387908b73f8f5ea539313c07c8c0ede", size = 1282979, upload-time = "2026-10-17T00:03:24.695Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b4/e6/f2b67c327d9f9533e41791804403ccc2dc457821195a2e51f0b587a90b90/ast_serialize-0.13.1-cp315-abi3.abi3t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:121e1d08d58b75c15491cc3003609cbad71ac2b0016043c36d30a6b2032b6605", size = 1303466, upload-time = "2026-10-17T00:03:30.451Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ee/80/bd29379fab2bce19adc0bf9177002b11b23dfe8d8fecf409998b458b4624/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl", hash = "sha256:d9c1a920b2aa0c1e016bed7721689717034ca0dba64ac3a3ff243b003d4e8dd8", size = 1459779, upload-time = "2026-10-17T00:03:35.09Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/97/897e33bef2eefd880e6350e375cc66bc5bcd00a139be480fd655f5b3f095/ast_serialize-0.13.1-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl", hash = "sha256:0d764913374ba21df8cd618045b371ed104ce55c6276de7c59e554a4f5ba26fd", size = 1501542, upload-time = "2026-10-17T00:03:43.08Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f0/89/0e30f9eddf7d44ccf9d25979030754fd0457af61fa4279acb8c293a04f97/ast_serialize-0.13.1-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:bf53a3ba1cbe45399fc1e4ccd684b8f2a11cca450f89706b79122f478534c6f5", size = 897546, upload-time = "2026-10-17T00:03:50.093Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/60/c2/98370845a7f35cb8a25782e78284b48e01bf3128339881d48d613f304f8f/ast_serialize-0.13.1-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:1b158f1c9e3a0d386913924c57995d6df78224868a4d0f215bdd41587c97b34a", size = 1229729, upload-time = "2026-10-17T00:03:52.825Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d8/8b/2d7ffed76addd9d3fcf37fb171400942735c8912264c763561a85407f6a8/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77a6201b69ce42e919f2fd9a559138d5410b5d8afff7c3a6b1f500b0481ff7d8", size = 1292255, upload-time = "2026-10-17T00:03:54.148Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c5/fa/da311559dd3dae9af5825cf21660775a929b970f72e3786af3f2cd667944/ast_serialize-0.13.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f99786e0d62082a5b121b3437f3167562133711df22128de1e9886f57f0b226", size = 1313260, upload-time = "2026-10-17T00:04:00.194Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c1/fa/c5f4a545f72a7681e3295bab6e3600ee0862ec4391bed961fe9f735b67e0/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:6ffb0f548a7dc126067fdfb7b2325ab5dfcdeecc29faf5e0f0461c96d6ebfa3d", size = 1469931, upload-time = "2026-10-17T00:04:04.181Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1f/bc/523aa1c08bd69b5654621beb3dc1a9035715a4a63762fb8d219d6fb3eb81/ast_serialize-0.13.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ca9acc67f796aa2554fa3037dccc022a4b08b38b2ad153edfac9c9bb7cb1f3c6", size = 1512140, upload-time = "2026-10-17T00:04:11.589Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a3/2e/beec3364eef4b01793a676d8cd16e9014c42044a5505000ceae3955e33fa/ast_serialize-0.11.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:f6a8dfc5ab204a706f6e5d39c6f77c18c27ef084fa2081803a64a9160ce89277", size = 897089, upload-time = "2026-09-13T18:47:22.69Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/42/8d/cff58d17ba1d0272ff0b7ab5d3bdfcf8f47317eb0f47c001d394bffebf95/ast_serialize-0.11.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1d6ad94edbe93bf1dabc06c9f37d55b898fdabc456aa6d7ced5e23c14f795f32", size = 1216399, upload-time = "2026-09-13T18:47:26.202Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/de/d2/a1da7675af5f42335c36e4da6d86ef4fd7168cead18de81df0a2d6faeb1a/ast_serialize-0.11.2-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40b2801cf2221bd922d9f69d2f0ebc373c3db47207315d525b2d87fa161a2af4", size = 1282064, upload-time = "2026-09-13T18:47:27.787Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5c/9a/84a22420cb312642d7d31547c644d09a3d101418c6d6b9ef2ec30735cf11/ast_serialize-0.11.2-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efa819d7c14c8e4153dcd84671826331538be7cbe460383fc6386f5eea5bd234", size = 1301941, upload-time = "2026-09-13T18:47:34.418Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/51/52/54eeef9918e187ced417c4363eecea66975314cd5b9c91759eef7f7b714b/ast_serialize-0.11.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:0de02520c11391a026e62987a9aa2c3c2ff01545155059ddf0c4bdf2c5ecbe9f", size = 1459057, upload-time = "2026-09-13T18:47:39.891Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/48/a8/bdd3989f19de09cffcd8179c131f6741a5a8619705fc75b09541ff61530b/ast_serialize-0.11.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:08eda88a0f290a36c38cab33df8bf7e35eb95bc802ca5beb2c8fcda471a7d10c", size = 1501597, upload-time = "2026-09-13T18:47:48.265Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/ad/439c2959150718446af76fbe2f4000f35eba9869ef8564f3d9a3d0b1c370/ast_serialize-0.11.2-cp315-abi3.abi3t-macosx_11_0_arm64.whl", hash = "sha256:a586be418eb70a9f1396cea29ddac8f4b9bf277fb73ea2340db31e218bc00f32", size = 1215705, upload-time = "2026-09-13T18:47:56.178Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6d/d8/2c6542fc3e7c56a0a25d8d12d034d5a2d2e1900e292567b1c1dca8e83124/ast_serialize-0.11.2-cp315-abi3.abi3t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8532f20916fa3189d4d785ef2a62d93c4d651ec9c5bffda66d2fc36898351f34", size = 1282530, upload-time = "2026-09-13T18:47:57.619Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d8/85/754681846f26e0ff1da729b1ffe3171e93c22f0aa6ec3cea5b14e3703846/ast_serialize-0.11.2-cp315-abi3.abi3t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b78e6fdef3b06c86ed263e1962fee5a7b9d2d158e738b212d13b2c605ee12f5", size = 1302271, upload-time = "2026-09-13T18:48:03.915Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bf/cc/aff4d84c16afa742d13a75384127c7d24594dc8c304f0558a15924fd51af/ast_serialize-0.11.2-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl", hash = "sha256:bfbe47a3a7c368f28836e78b2440a3643ac0ec4c67d9fe53588e1448f0a3d35d", size = 1460006, upload-time = "2026-09-13T18:48:09.162Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0e/16/d3703a7c1e3c76b144ac9349a54d3926d0749918a8dc13a66cede208b8ec/ast_serialize-0.11.2-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl", hash = "sha256:9d80a81ec84660422579bdb8e789f656a794b48c7a1ae1261f6bd8bc1897d17d", size = 1502499, upload-time = "2026-09-13T18:48:17.405Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/45/7d/c4f36898f19c728d091cdfdf960c9488e8d82bbe2e49ba13c05f43907a5d/ast_serialize-0.11.2-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:89499a439955931281986e97ca4dd3c064bf0d2e0027c0017344eb86667733a1", size = 897204, upload-time = "2026-09-13T18:48:23.695Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9a/7e/8f2ab68bddbe58a66fbbaad87beeae3e7d7edddb17263d1fc423936cf34d/ast_serialize-0.11.2-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:1844ed9a487fb3de7325c52ddb33f2918b66b65cd54d3f8d83d23785ffe99fa4", size = 1228053, upload-time = "2026-09-13T18:48:26.788Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d2/1b/8a69ab68f4c1603819f0481d756abdd8caf27cec7f1d77caa71007ebe997/ast_serialize-0.11.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b17869f4ba261a5fa468a753328a548f4dbaf74b4eadae9e28aff66df7f1425b", size = 1292542, upload-time = "2026-09-13T18:48:28.295Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/04/6f/4c992cd7841ba589fefb14ddc9aff2f6db7f2a615d4074f9ad04115b5ce0/ast_serialize-0.11.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a7004ba572f09be34342ccb98dcd4bad5707d3d81adc8cb4c3f685d2a2c51bbc", size = 1312642, upload-time = "2026-09-13T18:48:35.294Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/42/3a/250643ffad02bda520c50a9a5f02a5d43259a06f34ce393c91761d134d7e/ast_serialize-0.11.2-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:00bbf1f6669f813b48925b759f7ae4591067d456d443924055cab386e7e0a719", size = 1467653, upload-time = "2026-09-13T18:48:40.348Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2f/eb/6108fb9a43fc7ab5529856e38e33c6e3e064fbfe375fdcbb208c7cd5438d/ast_serialize-0.11.2-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:2fa3be25f7f5351b1b39c9f8a52779b2dbf21199efbae564b4746422e8edca4e", size = 1511621, upload-time = "2026-09-13T18:48:48.667Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -984,7 +984,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "django-stubs"
|
||||
version = "6.1.2"
|
||||
version = "6.1.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "django" },
|
||||
@@ -992,9 +992,9 @@ dependencies = [
|
||||
{ name = "types-pyyaml" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/56/d0/00a9af43bf65ee54706e29b1c41b3a00d7a97157fbf97ed3038dcc73d584/django_stubs-6.1.2.tar.gz", hash = "sha256:d62b15fa5cbae79b1922d015e1454d299959d230221dadb23f65c749480b97ec", size = 295860, upload-time = "2026-10-05T06:47:17.595Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/2b/d6/fb467f5f769b831680d8cb6705e4bbec335c79b328ff7e347e220e676da8/django_stubs-6.1.1.tar.gz", hash = "sha256:291fd79197416d191ec9f4e443bc6800b64dd5d41e476b91e679495d005f3d61", size = 295523, upload-time = "2026-09-14T08:46:24.686Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/96/36/206be00ba6aaf21c72cf61fd38cee492c7dcf51eac72fd61a9f7ddd0f916/django_stubs-6.1.2-py3-none-any.whl", hash = "sha256:ffb6e74f54b8c1f9b2f3bc4852c5abbaa2324b2a7cb1c51854c5f95abe67165c", size = 559846, upload-time = "2026-10-05T06:47:15.889Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/26/911e381b1cee7fbb7f11f640ec4be4ec1b6ae49dc58ff2cb829cf12dc4b9/django_stubs-6.1.1-py3-none-any.whl", hash = "sha256:a913d0c35242cd820f638486118fd542d687b6a85104bea9cb7e635b52b889e3", size = 559401, upload-time = "2026-09-14T08:46:23.153Z" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
@@ -1029,16 +1029,16 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "djangorestframework-stubs"
|
||||
version = "3.18.2"
|
||||
version = "3.18.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "django-stubs" },
|
||||
{ name = "types-pyyaml" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e5/9c/4b03ddfad674f1af89fed3d17638fd6e5893c2e5d33871689a135cbef5e3/djangorestframework_stubs-3.18.2.tar.gz", hash = "sha256:a8e009eee5e7c78c0a0a28cc69875bd1a44bde5499de085e52461479dc9522b1", size = 37849, upload-time = "2026-11-02T23:46:17.881Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/6b/71/a7727b07e0433da02fb1ea22994f492ecb437a1fe7be5bf952dbb545a0f5/djangorestframework_stubs-3.18.1.tar.gz", hash = "sha256:65ed4a9ea094616759a2cba4fe0ad85efe25b471b28281b790bfefb46704c64a", size = 32439, upload-time = "2026-08-25T22:49:27.506Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/fe/0c/8778cb6fdc650867ecef1b2e5fbc6004906d37cb7bd4a781bf25f503f57d/djangorestframework_stubs-3.18.2-py3-none-any.whl", hash = "sha256:fb4bffc3037063535390fd2cfde11f81c182e05949220d4742ffc0485218972c", size = 58013, upload-time = "2026-11-02T23:46:16.487Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f7/1c/e266828fe2b78484651667976f8539e47b4e511a266424b890f613c6b7ad/djangorestframework_stubs-3.18.1-py3-none-any.whl", hash = "sha256:a2021f45f7759b493504c2a721f112ec4fd677753590c1ba346f4ebfb49a7f03", size = 55685, upload-time = "2026-08-25T22:49:26.178Z" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
@@ -1811,51 +1811,48 @@ sdist = { url = "https://files.pythonhosted.org/packages/0e/72/a3add0e4eec4eb9e2
|
||||
|
||||
[[package]]
|
||||
name = "librt"
|
||||
version = "0.17.0"
|
||||
version = "0.15.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "mypy-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ed/82/9b31a8cd0fe33fde43132f43d2dab766976afc0d3d0763ea6082c4385b22/librt-0.17.0.tar.gz", hash = "sha256:fd18d1f708f78577556a7d76505048b9e3ad6ff61b8d9c91616a5a3f1e6c770b", size = 240190, upload-time = "2026-11-19T14:10:49.327Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/36/9b/356320fbae2ac8467e21c5e73e1389c80468e4998c62cc7d3536cc51b614/librt-0.15.0.tar.gz", hash = "sha256:4e66cbe84437497d951b799d3e1551291b6fb3d643820a7014b3655d57a59162", size = 214338, upload-time = "2026-08-07T10:49:42.663Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/02/0c/dd328f18f9b12e1c5ed82263f762d1961cf3d8039d068127190611994828/librt-0.17.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:00c6499ae28dcf5882547dd7b5f8e69e119a68e335a4d7244c278c2cd849b8fd", size = 176052, upload-time = "2026-11-19T14:08:28.768Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c3/ee/f926a8967973c9bb5853dc59c4a8695da7471057b6f5265db8b9ff01147f/librt-0.17.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7be0c07b6185548a1087f3120dd3d7aa64c07813f8b76b8fc97e2b2a1fe36450", size = 576194, upload-time = "2026-11-19T14:08:29.854Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/eb/b1/a5466d1a81db0f7a08846893a8f4692cadb9802eed43899b3d5ff15197f7/librt-0.17.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:598c5455f07fc182a926b88e63776c49dc4cf47465c998cbc6ba1f010b875b51", size = 604649, upload-time = "2026-11-19T14:08:34.057Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8f/78/aa5be904719cad4c105cddd1a170407a926d59fa4b93a79e2fb18fe32d8a/librt-0.17.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7f8600211ee5eebba8a5436219636c6490d74bb342155983b8def12ddb976d9d", size = 622868, upload-time = "2026-11-19T14:08:36.82Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/71/12/82136f3d3e971cf7dfe66aeadbf12689d0aed6fd9aa923309ee88d3b92db/librt-0.17.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:8717505c32aeb19fa8a85bfbce8f25dd092e497a4ce78ae52f508d5c3beb4f87", size = 650299, upload-time = "2026-11-19T14:08:42.346Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1f/d3/64490c89bb0cbccba16a5c13118a8970f60e8dba86a0fd6f2ccb4a7c01e1/librt-0.17.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:766b874a93f499ad64b33f0d75c993e218cc113c74f651bb9867f275c92b4059", size = 178458, upload-time = "2026-11-19T14:08:48.051Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c8/48/0febcc7e15999caa97a3af1f51a5f1a13b485738150491eb620f54ef3eb7/librt-0.17.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3e8ab915c48e949dfcb0a2b299af96a6707d561fa7079a21169a4bb2aafc45e0", size = 590405, upload-time = "2026-11-19T14:08:49.216Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/12/7d/cc942cf3088e1544053ec36bd3a8266a755251eeb2c3cb5329eab54c80a3/librt-0.17.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:afa8a6a1916f155e6f35c48d6cb547849af79e07060e36b6aaec1d1c63dc3c7e", size = 623563, upload-time = "2026-11-19T14:08:53.32Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b3/ca/91172e4c888c0bdb7c2976d2220913675c0f8df7154ea566a90aa08a9d54/librt-0.17.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:477051a5c98895a0a6ea67cf33b84618adc10dac28f348efc287e170913097cf", size = 640205, upload-time = "2026-11-19T14:08:55.869Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e3/5e/2d33a4e2bea5f5a30c641c7628770045a39850db4129ecd529015e00222f/librt-0.17.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:d5ce86ceb3adedb4f26d8e39de1f96483f4c348c32874deee7622314157f7dcd", size = 671611, upload-time = "2026-11-19T14:09:00.786Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/95/20/65b566c337a0c7b9b3395243ba459d6f6790ef95fa625f0cf96f11d41096/librt-0.17.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:dc13eca8c176542b45c4c52ea31bb9e150f3156445a94dde497b7f3880779cf5", size = 178511, upload-time = "2026-11-19T14:09:06.465Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/96/64/d5e9e360d68bd30c9d88aa6d1fba0d1642a87b22fb1e78619f94c6bd92c1/librt-0.17.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:343d12d5afd461a134280082bec8fb11f3880c83f9caff3de5268f933b7c826f", size = 589797, upload-time = "2026-11-19T14:09:07.601Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a1/9a/0c3ab8deb865fae9b18a25f951fffa28d1c5af3458f6f8134d9cad24780c/librt-0.17.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e3dad4792d84979f5f1aaa46d22cd062b15f4551bcadc7d2b695d42aac971bf5", size = 622828, upload-time = "2026-11-19T14:09:11.183Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a8/1c/c28510381a752fc5848b4c33fc1b0e2f00254a69df1a7fe3708a616925a6/librt-0.17.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:dfd17a61ade81f579d64e50461524bd96255168eab42f56eb1047266dc38adb2", size = 639874, upload-time = "2026-11-19T14:09:13.987Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/16/2f/4bb1c72686c77fb142b98d19b97783a87f9620b9f730e18312534f6d0629/librt-0.17.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:20c742248ea9e1f9fb2ccbc44b5975d39f0aa4a52178429053e76526238fe14f", size = 672198, upload-time = "2026-11-19T14:09:19.573Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5e/8b/1642139cf8309ec08c4fe22386860096ceb4a5463ab23f48500fe0c72a2b/librt-0.17.0-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:47c9ff64c555e70f980313973c0bedd469d7379f79ce90bad551b4b2475968e6", size = 89665, upload-time = "2026-11-19T14:09:21.065Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1c/9b/95bf85408ac30f33f27d00ed15ef45b095fab11965cbb339e7eaaa5284ad/librt-0.17.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:810c55c2248af580c248114e3a8529677bb27fed541fdebbdad4e37339915f08", size = 178113, upload-time = "2026-11-19T14:09:26.729Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f3/0f/86b2d5024c0531fa2de12fac30eb048c7aadba0a24b75a2dab7782adc320/librt-0.17.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:87c5ed7bcdd937dd001d034e42de355818419a50c1d98f8f241a7cb8615c7dcd", size = 580062, upload-time = "2026-11-19T14:09:27.879Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/71/85/4d4525b1b84b85a9ed6113ee80e36853b8102cd6cfe902dc5de8e7280fe1/librt-0.17.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de7dd4d3ec15cf15299cd30839773f58d6dc109a057cb2c797bb11fba478721b", size = 613660, upload-time = "2026-11-19T14:09:31.479Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bd/54/ef85de8d6a1ec02e6d687982c9fda1cc4529e264ca52abf7b9288e0c232e/librt-0.17.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:09b3638d04e8089256615b776b40d3977566ee27c1d2d3e8ef7856c406410063", size = 630560, upload-time = "2026-11-19T14:09:34.795Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/65/e6/bd0381728d134b4ee710f5375783c9ec2ae2589e2584f7bab477639c7049/librt-0.17.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:28c174fc28a859189c6c4d370029a8d33e24f0147839c8ee35110d111b0b6fc1", size = 663123, upload-time = "2026-11-19T14:09:40.405Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/08/8a/6a6422bbb1832619e32fd2ea7c36f977f664814b75da0ead39c1cdb7b83e/librt-0.17.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:b3132402abc0063823c91012bb74ae02787c8f77086e659f9b41655d3ef18b71", size = 88933, upload-time = "2026-11-19T14:09:41.67Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2c/de/fbf00359194cd86b605408ddab944cb38eb36f7a4a881bb67f0402795a1d/librt-0.17.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:e70f1366f7bb9771865aa8c22da92e36a42343b78a9ced1c379b066b2b46eca3", size = 188421, upload-time = "2026-11-19T14:09:50.068Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/76/af/571c068d03462b3353b188832c7c4696cac4db6502cde45553f16a3f0699/librt-0.17.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:00bca40134bec8887a05a46188c160994414231fa5fce63a9695e0fe6120ab8e", size = 815451, upload-time = "2026-11-19T14:09:51.738Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fb/dc/ed1f2d4656050b546eddd02c282f931aa65fdf120ec3ab72ab564bbc026b/librt-0.17.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:012f8d82d1c6c7d682f607fa2d550fbbd8331b3c4788fe5b49d44a9040dc2b15", size = 835292, upload-time = "2026-11-19T14:09:56.262Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/56/9c/830d7ac3495d4a937a587ee58588737c7107634e9aaaa47adf6f30f7d4ba/librt-0.17.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:b1936d4823e26b7a3abda2ce86fc59536d5bb60e7988e625ac0134cc4eca30cf", size = 878244, upload-time = "2026-11-19T14:09:59.261Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/52/01/24af76e60b109e9dadf224fd6146ccb6a6b6988b29697ea7f376d78c736f/librt-0.17.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:c32d5577eafc07909517991d376051e5c9c325caac4f29bab850826847bfd821", size = 901214, upload-time = "2026-11-19T14:10:04.498Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/33/39/1e915df6856286080328d5bb59f6212ca898177e6703d51f9bcdfc33d4cc/librt-0.17.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:b00337cf863338beb677f1ee84eb5d1e7c2b9e6ff3e1737951731bde24d95997", size = 178033, upload-time = "2026-11-19T14:10:10.542Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/de/4f/b318012f19e8d255c2f0f630ce2e52946161a0707e670540f8953bc7d736/librt-0.17.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d32a83e07306f4dad53a264671b55380e418f51d4420da85273725492189f95c", size = 583638, upload-time = "2026-11-19T14:10:11.684Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c2/77/c46367c17519e22d38bc07e11d5495565e5bc22112924ace7127e13740b2/librt-0.17.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dfbee84c9e0bf961781e45201e1ad110dc4e85d9ad3bad266193300d61f842ef", size = 614977, upload-time = "2026-11-19T14:10:15.537Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/28/1d/314e4490e5cdf61faf5e75d14fb78487515537e3eddd2719616cd3683c33/librt-0.17.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:681d59c924342fb1478c13b64c34c081051e1a8916fb6d3fa47ab06db79fe2a6", size = 633093, upload-time = "2026-11-19T14:10:17.931Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f2/b6/e57f5d1ae1c5bc57bc9fc9201c6e988f18fa052333b07fc3a84452e8dd3e/librt-0.17.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:2929dc060fc953767259176b8ebef6fa8f51e19c6ed3e832a9e36bdecc4f9cb6", size = 663709, upload-time = "2026-11-19T14:10:22.726Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1a/7b/6bcf8ee15a4dbb2a42be5dbc247243775b32453e3fc9e622b3f372395006/librt-0.17.0-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:a78889bdd2ee392dccb11709c5ac1a7875aa6bc4bf46e7f329d5e39b7c2ddca5", size = 89059, upload-time = "2026-11-19T14:10:24.026Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/02/eb/761675510b5d5a84418ac087e24d3ec848bcf3db4818c3a7bfd35d392b56/librt-0.17.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:271f9a8d2964c596b1d0e09b4f1507cc3b379d2fcbf3c6bd2eb23a051518a4a4", size = 188939, upload-time = "2026-11-19T14:10:29.678Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/43/14/ef6b9df1da067b9d5e38ede787395da1fe03945e8c67c06cd9b5546f595e/librt-0.17.0-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4ae97bb49097ecdbc974f9ca4574ab2ce5827a0e5c362887dcb5a423c1024a6c", size = 822775, upload-time = "2026-11-19T14:10:30.835Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/01/2c/7707248709688071e15116a5456b6ab556a5f74d228d4d84b8c7289c1424/librt-0.17.0-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a91a9bf401629d570614308a04625d9b66fb6e6edda57b90551b5d62e0d69fa9", size = 839830, upload-time = "2026-11-19T14:10:34.422Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/37/90/f9afb70bafd93c646a2a162c48483514db3335f0501537bcdd49fe5087d7/librt-0.17.0-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:cde2f4b096780c848d0ac92b02965552fe14479400ac074b9c7764b202a4c2fa", size = 887761, upload-time = "2026-11-19T14:10:39.544Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/be/ae/35452d2a93075967ecb93c70077d468c4ca800991f388b099c7c7f31da81/librt-0.17.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:002d5eecaa87785f768d8149827a433829c81b94739925b7d56212a791dc912f", size = 907730, upload-time = "2026-11-19T14:10:44.817Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e7/1d/8e150b7fc449a1f33c8a760965cc1f43b14fc1577d9d0b50ab2701420e74/librt-0.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c70bc1b602cf59917e8f0c7a2cbc8bcc6fbc14d5486136b00707a79619121d63", size = 153067, upload-time = "2026-08-07T10:46:42.418Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/51/87/a162bc5a66a35599dc619ecb215145f4de7d68e886b479b6d12593139f7c/librt-0.15.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:814ff83a25b5fce8b9c80c4dd803153fb5c5599fc74db9e022466938368957ef", size = 493087, upload-time = "2026-08-07T10:46:43.657Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0f/e1/7a65eb5dedb1f00aebd948cdd8e17add48bf066cab3514e9daf84ab45a6c/librt-0.15.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f779070399f991400fc451719e0ea388eb7de313388bada2c127a35de05f798a", size = 516002, upload-time = "2026-08-07T10:46:47.599Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ea/0d/37fa73f3b43ebd8259f91ae9102a15e5a54e65d581e48dea72df3e81d7a4/librt-0.15.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e0d00c708fb2f5822b152429b1ac80a58dbbbc3f6c232c4d13a3f7fcf2ea5b4c", size = 530422, upload-time = "2026-08-07T10:46:50.45Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/36/93/f8aded0d6682b4f25820fa86e0690f87f01df9fd7bd09ddb04d9167ad021/librt-0.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:97335f59082f9fe2ce6c2a9cc6433a0114bbb6cd4d5c09dd76c95c68b9f9a8b0", size = 557686, upload-time = "2026-08-07T10:46:55.443Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/14/43/f4b1bd1b2888798a1409808889a25ea1ba49eaabce7d681ed27734c2df9d/librt-0.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:71599e011ac880e8e45d46047d714871894c7d4ab6f25626f8d4f89da21f368d", size = 155267, upload-time = "2026-08-07T10:47:01.311Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0c/db/3ad9c965c72f1e1d6beeec44ec10a54e17be8ae042fbb4baade16cbadced/librt-0.15.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c802434092b769b1d613ed2e13fac15fbfce1934a74bd10283b03c0fae231cd1", size = 503136, upload-time = "2026-08-07T10:47:02.45Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a7/b9/bdbb0b648b5c2befb031f4c6f3b1dd857415e8fb492a25a3c764a6681e6c/librt-0.15.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:89cc46cfd15022e35084355478c9ac809d90b1152222706ac9a7655ec21df6fa", size = 531904, upload-time = "2026-08-07T10:47:06.211Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/26/60/03b3abb82b41714671b907bf6989b228e31e6a8af52dec82b5b0728dc250/librt-0.15.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:cc30523e3f1a23fb7511cc659834a0d01a1042bb9de359bc1c131cc4ec6c9656", size = 543155, upload-time = "2026-08-07T10:47:08.866Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c9/4c/cf9601c1b4c5f09280acd5d83abdb2e68527a2be8257136eb42304218622/librt-0.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1e47b8ba865d7ede071a91a7163073bbaeb72541f1ef8a07d512c45c7b5007f2", size = 573688, upload-time = "2026-08-07T10:47:14.727Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3e/e6/36c2299b7a94b84fdd01220d8a777a71be5be0925bb0dbdf71c0a06a34d9/librt-0.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:aa1f1995789dca3698bc550aaceb09a51bd5df0a057ff84ff15296cd1975b801", size = 155194, upload-time = "2026-08-07T10:47:20.398Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c9/b6/ed5071f9325845e670bd36012757419767fbf56af77ed483077b9e4db541/librt-0.15.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:55456ea87d8df21808446d03817be2f65e20391c1c615d9187440dff28cd08dc", size = 502568, upload-time = "2026-08-07T10:47:21.652Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/e2/c08fd1d36ce63ea5a12b85c5d37f4550b5f86a692167e41e5a74222607ae/librt-0.15.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:234d8d394721fa0d786af15ebf1f3fb7f3ed82fd1cd0cde45c2f247b5d4281d2", size = 531661, upload-time = "2026-08-07T10:47:25.507Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/10/cc/075171517b41f861753034fbb151b42cfc83bcc853849f24f5e66fd60ccf/librt-0.15.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0f0ee3644d951f31055ad07d77d92520e84505dd7a432cc4cd501dd70ee06785", size = 543201, upload-time = "2026-08-07T10:47:27.999Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1e/88/c6dcf0dd8e26dc0c9a499a2abab8646c86dcaf9ecea9524cb46d3686331a/librt-0.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6d28a05796b99f749bf8794f17ba9ba1612d0076b802e9cfc62c554634e9ce3b", size = 573700, upload-time = "2026-08-07T10:47:33.527Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1b/9b/ab54c71a7918a7c34fa5327fb61390a77446a07a146fbfb1165250a61035/librt-0.15.0-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:2067ff438048cead9d223ca5675bae2a25e520a7c3e6c1498bf9c6892d22caab", size = 82194, upload-time = "2026-08-07T10:47:34.835Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/61/ca/8281aa6cd560a3420e4497729f6b704b53be3eeaaef82d5aeadddaf7441f/librt-0.15.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:6c0eb900c0e91f4aebe680845242e614f1864edfd44106380d0752ac29522bf8", size = 154088, upload-time = "2026-08-07T10:47:41.065Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/dd/02/1a1662dceaba6a086360891448d5ce9a7d3555976cae59a31a39d744b9c7/librt-0.15.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e8c9a650a188e38bac005048cbe6342e81407782944d01934540ab75e417df21", size = 494215, upload-time = "2026-08-07T10:47:42.388Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/95/82/01940e40b83c43a546c4a3c896cf34ca272a9690899d55914e4827b3dcce/librt-0.15.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4c7bacb70930f3d0a56f4ecf1be474a1f0d941b01dd73b756f3c256d42cb879", size = 523073, upload-time = "2026-08-07T10:47:46.66Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0b/27/894e072228fcb159703c655da69f8cd10dbed489c36e3df7dd032a2483be/librt-0.15.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a417149c0cba4d50b61e992e5a15e69eaf96746609b461cc4ed168aeef6b79dd", size = 534164, upload-time = "2026-08-07T10:47:49.875Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c6/4f/d1be6a01a35c20ef734e0e44113f87d4af756a9354a89dcfbe3b4f8af5e1/librt-0.15.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:96bb17dbe8bab3c0954fbebfc69ed395599de75b6bbc35e3270a878e15d4dd65", size = 565868, upload-time = "2026-08-07T10:47:55.566Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/67/88/649cfa33f5825927b160610f670bdab012a64d627eddb94fa795ea4292fd/librt-0.15.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:7220697efaa6e5348fc3d18ee7f8563d4bfecd9872b37ffb915bfc1d08840622", size = 81619, upload-time = "2026-08-07T10:47:56.886Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/75/03/1b53cd4ef904e73b1d828a5f90143bf94a2967d7cfff0b9ccf93e12aa9b4/librt-0.15.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:8b2fdd7ead3c995c37940a790690660d0ca006c302db26cc51933f6766866fc3", size = 161638, upload-time = "2026-08-07T10:48:03.725Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ac/c4/9f9c9fba097d49e9e694c2b4dc331df31884645ecbc58a93b4b5fc69d2c5/librt-0.15.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2fde98cf1fc4bac144ce23c2c4c017b924ba714509ea9334977b0b27050c837d", size = 701795, upload-time = "2026-08-07T10:48:05.135Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2e/0f/1aed6223d4f9f9d1171a8596ff100ea4c3f7699fea7a4ba657c3e60daa6c/librt-0.15.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b845b8d48088fad0cadc84be4b8fda63203be7e9237b71015b3925443c1f35ab", size = 722542, upload-time = "2026-08-07T10:48:09.569Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/1b/c327ef6018e3a9ca0b8e7c5eddeeb331ba8f9b76c24e126d37d0f6d62faf/librt-0.15.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:64b0c8c35aa4c4ed79896359f3e0b285cbe4e610042106500da4811c322cc108", size = 752891, upload-time = "2026-08-07T10:48:12.558Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/79/91/2270a9380f11725cf83ce1925a5e32dd1dde2be9bba597f25c10a38644e7/librt-0.15.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:c7eec6a42018bc1d45763b1c162d3d2bf7c3b9a1b0ed30d3e91dcba390efefcc", size = 774417, upload-time = "2026-08-07T10:48:19.611Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1f/eb/5d9ab71e30119c44094e0275f38b47dd327aea0f843a080396677029d508/librt-0.15.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:6d15a29033c57490cfe2069097c6fc4049e4e65ffbb749be7dc453b7c4c68965", size = 154510, upload-time = "2026-08-07T10:48:26.485Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d0/9c/8505d1b8f5e8c19587bd03f7429993b3e9ce5c06819d856bfb11d919374c/librt-0.15.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d2c05c729b589e734c09578bf5964be48a911765484840d017bbc84f49d4c4ad", size = 497543, upload-time = "2026-08-07T10:48:28.045Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6b/c6/2f4dd296c97a0b85b98894519b279408ec9dd602d4f692b1ea0e25dee670/librt-0.15.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:86a21a7bd3fe3a419512ef424cc1c020f6771d0b29cfddff36d1635a855e63f0", size = 525122, upload-time = "2026-08-07T10:48:32.7Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/91/ed/4bad71adeca8fe208b775c2a35417fa5a2584c8f4791daaf89a89450fea1/librt-0.15.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:d8edcf6f550e918dca779c069b9e156385c60b406f99fc7641f32c52f7193659", size = 537258, upload-time = "2026-08-07T10:48:35.88Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/65/7e/c2d98766124400d722063a630b0fde38a9fc768705d37eecca15c47dc192/librt-0.15.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:32896a0af72508ea979e0acb4e4c04cbeeae04938167950d535c83c45597167d", size = 567736, upload-time = "2026-08-07T10:48:43.124Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/55/6c/f8c34a95e3a515c6e1c192b89511e7253c89a7760c6b500d57ffdb8d2dc8/librt-0.15.0-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:ec3ba415afaf951f6951b1dd16d3c8e4f540065fc382d7e70b823a79567ca374", size = 81673, upload-time = "2026-08-07T10:48:44.645Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/06/bf/043097353f9b3c73b583d07f6b8e552795463f4bfc8caf85e42eee50c26a/librt-0.15.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:e0b5deec9a8664eb722c797241970fd4aa1894d25fda36a1ddac0f7407606bd6", size = 161686, upload-time = "2026-08-07T10:48:52.174Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f4/2a/8ae77f9719d42ce71cd708560a3557b38ac3c17a0383e57f87084de45bbe/librt-0.15.0-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5563302a8359bc2295bb7084d1a8ed1519df96afb30eb2aa4e0bff7b54228988", size = 710668, upload-time = "2026-08-07T10:48:53.782Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2d/53/b34fa9d0ff00f136f4d58ebb4c411ff634baed1eb412bb602a2bc8dcafcb/librt-0.15.0-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c47318cd3a61401452de11282242937e3e057c4fd3dbaf601e269d0928a06c0a", size = 729847, upload-time = "2026-08-07T10:48:59.231Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8a/f1/e17a9bb5de6fb8c3186ed1a7d68d21618b027ac2d3633e03d3b6109c67ae/librt-0.15.0-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:077471b3182db4e17c36ae91555f36a4d2c00080b267f749bcad34a478a9a302", size = 763454, upload-time = "2026-08-07T10:49:03.039Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/40/32/a04b72b1aa86e3be23b2ecff8c1aad2dcc955bd3956d6d26e7e34267e57a/librt-0.15.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:291bf73caf78b9e88d6fae9bfd693207ff7d832e2fdbe2cf8e746bc13f5f892b", size = 783763, upload-time = "2026-08-07T10:49:10.661Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2271,7 +2268,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "mypy"
|
||||
version = "2.4.1"
|
||||
version = "2.3.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "ast-serialize" },
|
||||
@@ -2280,39 +2277,39 @@ dependencies = [
|
||||
{ name = "pathspec" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/4a/3c/78ecece71ee4b5445389a4ccd11627cfb9c69e4de554d11060171f376305/mypy-2.4.1.tar.gz", hash = "sha256:63b590965691e540a335fa74dadf31a7069142f6b72e234689bbd244edf55623", size = 4066728, upload-time = "2026-10-28T19:23:13.286Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/82/6a/878cc1097d4035f82bd516658d0c528d2a9955bc7b363afcbd0b07fea11b/mypy-2.3.1.tar.gz", hash = "sha256:47c1b1207258513a9d93495f69c8be9de73916186f0e52703e8c461b7a623419", size = 3992554, upload-time = "2026-08-15T03:03:38.549Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/4b/8b/2bc7f489528db504221ad7eff6b3f83979ee57d066103c72a85d09046a30/mypy-2.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:79a1e79199e980fb41f219cb3d4746d25c64b0b623840d3ed57df1cdc13a6502", size = 14321495, upload-time = "2026-10-28T19:21:16.612Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/18/9a/b2f037b4982dce33645296e4394b031ade60f697f468761fa3ea8e2f8ece/mypy-2.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e18d0da3898b3bcd16192f15a206e7b8b8dd0f4a0b3e51aa5bd5c2afe749e2c", size = 14467468, upload-time = "2026-10-28T19:22:10.629Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c4/5a/379f9bfa18bf3f8d43668fbd9ae4f2922dd027a559c461ca9d41cde1d32e/mypy-2.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b69a15fc2e75858d6b15e91ed3a0dcff1a533265183b64734138791fe0f49aa5", size = 15421496, upload-time = "2026-10-28T19:22:48.005Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/83/50/3bde18a2824ec296432cebe01752ccd0ab8a2ad784abe4390040d019b3bf/mypy-2.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:70971cc0bcb1d3f03d2eb68fa430a6481ccc03558dc001d9534d7e5fa274c392", size = 15670425, upload-time = "2026-10-28T19:21:57.026Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c0/1a/0be9dc6af5e0e04128f18a5e36b4ca44bfb0085857d37aa6a7de1ac2b0cb/mypy-2.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d63737426a048a27705a4eedb828669f4bc0873612a1b46b0b9fe892b2ebaaaf", size = 14381321, upload-time = "2026-10-28T19:21:54.223Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0d/a6/7907e36711a8a8c703f961f076fab61793383694140bd1fd87589f3f68d4/mypy-2.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7344869cad05f073b8cae2826774fa0161e3eb2f5c685b76813574008d77d750", size = 14466373, upload-time = "2026-10-28T19:22:25.211Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5d/b8/7313212b29de570c25c9859d7c8e4ef2251a6d34338a1e20031d94297721/mypy-2.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a20ff6cd2af7a670c64f089bfa5fbcebe8ff3bf896c5e6ac7c9862c7960e4494", size = 15553666, upload-time = "2026-10-28T19:22:36.511Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/23/8f/92966b6082ff49da9142e1e527eb9af4359a9a61632a1cfc313da96b37fe/mypy-2.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9ed1195502cca32be5ef756b1693477f4991db2f2e34eaa90cc4ad6bea4f9531", size = 15802641, upload-time = "2026-10-28T19:21:13.421Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6a/65/cd19bc06b67d2df4828220245fd98569ba40fac00c60ba48bef1817d8ac3/mypy-2.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3f1613bfe6726169a5680ec3dad5fe1f6d96285c12aded51ad432eadedd39d45", size = 14214179, upload-time = "2026-10-28T19:22:27.49Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c9/db/4d54ca4f49a0113d0c956980272aefdc6eec5458f7a72b350785b9ef2249/mypy-2.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:680ba5d9f0e3fe0c746b3d14df15f2a718e4bc308a1145616a1ea691ce7c354b", size = 14376217, upload-time = "2026-10-28T19:21:08.019Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a2/45/089b4724b85f0f408941be5298f817ee89181c1ce031a73d60ebb150c2c7/mypy-2.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb70621535c22fd4b1a0450d37ed1d6c5eb39656a1cebfb189084c12de54ba7", size = 15467623, upload-time = "2026-10-28T19:21:21.555Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/27/4c/15edbc64b0b1412bfe94c74192b3b56554ab642b85a31bb06cef6313101f/mypy-2.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4af5ad558033bf71a44a1be149ed61633522824f84c1b6bc2445d3fe2d2a5296", size = 15729867, upload-time = "2026-10-28T19:21:37.557Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7d/75/282d43d6fea7be984ac63e75ffd8eee146ba2f3b077bb1ca5bf3f973e0c4/mypy-2.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c45485061ba08f700acc12cfc8b177e6997e6bc353605babfc0abb081e079456", size = 14233251, upload-time = "2026-10-28T19:22:44.977Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ac/a8/9021263cc7e761451c7d8131bdfab3c0a5c2d67aa2d694670019e1ab86a7/mypy-2.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:727890a32f1858c09549eb55a8b234fe990d460450b28f03e8213ef925f1247c", size = 14394953, upload-time = "2026-10-28T19:21:29.492Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/16/10/4192a5cea09ebbc41c534f57bd0d8f0fb42a8e810632cda6e37f072c59fd/mypy-2.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:beb254fec368c4e7f7f82a5f310c6470b893ec88a90b66426da971c6826b0453", size = 15442824, upload-time = "2026-10-28T19:22:42.068Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/99/e6/d3b0a7474aa4f696594a47a218b6796d9c4346fc81ed288904278cddd9bd/mypy-2.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ec416d5d2ae689e681f5727e328723f18d8b5dc8c903a146b7851dc5727aad8a", size = 15717227, upload-time = "2026-10-28T19:22:54.026Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/48/6a/2ec530dacd4f77ca50d0fa05b854098f2d75e5d18c587d2612b44f10d68c/mypy-2.4.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:0e95ad0bec03ced9a73b42514208abd24c789e67f0e1eba476e276dd7a2dea3a", size = 7898637, upload-time = "2026-10-28T19:21:41.709Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3f/f2/827e356fc4f74c60b8da42663336e035b49d948a3c11224b0fc7543086b1/mypy-2.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2875280687e64740e6ddcef43bd4c5852ad45ff34549740f6aea3f0373870b93", size = 15713427, upload-time = "2026-10-28T19:21:26.757Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a2/fa/e58a4fcae1d238189eac758036c0921992a86e3e6209190efd96d61fc5d4/mypy-2.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ea0714d2bccaf6d010c970e1d3ba2c9c2add79d2030aad2ef03167d788948276", size = 15938481, upload-time = "2026-10-28T19:22:34.371Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a1/54/a20f881801b88900923f2be1541a4b438ad0f0883e03836641fdc3d7adf4/mypy-2.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:63c6ff0e7ea546943001a91639c9f0c64b60d239268fa5d29e4a6c87f82c2373", size = 17243006, upload-time = "2026-10-28T19:22:39.425Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/de/1c/ff84a6133a6e89c390bff6b25d9bad6598e7891b205f4b30b496906d636d/mypy-2.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:a5b5da107dc2c93fb0a22f7a45dbaea5dc131afc7056b5468d78e819f9a138e6", size = 17557728, upload-time = "2026-10-28T19:21:43.607Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/57/5b/e44a2edb0b25a9f1429de770e1d0238af23302671dd40c77ac5efeb0c559/mypy-2.4.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:db599d03e7d60d15f2e0a11665c18bc52a88699fcab990fdf8cecd5be8ac801c", size = 14243144, upload-time = "2026-10-28T19:21:10.975Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/59/d4/5c99dc3a28e11d2f0fcbb02df63d2d3e574dedc0f9f69d50901df305a7a6/mypy-2.4.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c6c7210e40dd423af7d65cbe428b5906d11dc60659337bdae4e5fdf02ce32ed7", size = 14409316, upload-time = "2026-10-28T19:22:15.515Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c3/c9/3108b38f4c30eabd80194f5d9771a87e27196c5e0ddb5bf4b99c6ed1e97e/mypy-2.4.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a2d4a51db92059eecc2c33b2a5194b28585ebfd917292c015fe87a77dbff6cd2", size = 15445573, upload-time = "2026-10-28T19:22:05.635Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/dd/12/84a53eceaf11c46dfd7931fb6b8902d01fb33787d3a991e81c461458150b/mypy-2.4.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:01b7718552d017f88d1151f3cc9d6556d778a90bd58060a2c3d87d070f9099fb", size = 15732989, upload-time = "2026-10-28T19:23:06.512Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/65/ba/bf017dc2abdf83b2f74e29c43834b7af67dc1f1b20202f02dae60b4781a0/mypy-2.4.1-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:3467b1d13000812ab85dc2a3834b9379ec77798ca1bcabe434e23fb21fead692", size = 7898932, upload-time = "2026-10-28T19:21:59.366Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5b/e4/b9b9c8eb09e70927ee65b1456cfed35710b6e4ff0b07f364ceaf2202307c/mypy-2.4.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:9d7dafd56179d296651df9e1844b91c9517c379398f017a2a435d077a28943c1", size = 15706623, upload-time = "2026-10-28T19:22:20.528Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/26/74/1ceb1ca884add0565e618d013dd24333039100dc0fcc42661561f2e1cae5/mypy-2.4.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d923cec43316f0e6736b8298fd00abeaaf348a091c20e7296b3aebceecb63eca", size = 15944095, upload-time = "2026-10-28T19:21:04.779Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2b/68/27bcf9b4efa22733b6050485ae37845b94c9b8851abe4fc60632d905c32d/mypy-2.4.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6e081b466e88d4343adffe11aff0f02df34b5b9070b4b700053a0b7294c0be1", size = 17223065, upload-time = "2026-10-28T19:23:03.724Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1a/a3/ed5724b317bf585c29f3c8be2792e97d45925d65a9c8af40ceeb267072e6/mypy-2.4.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:70196470ac300f444a302a738541101893c2c57804078b33690286a7899149e9", size = 17560589, upload-time = "2026-10-28T19:21:34.539Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/5c/6e8010f8f2c4ad817364592d4b3883633417269b913fc9d5174fdeb7e565/mypy-2.4.1-py3-none-any.whl", hash = "sha256:1784648d6ec8c2b5465e3f26241b845a0b3cb4e56c993c64abe16989e7698999", size = 2801286, upload-time = "2026-10-28T19:21:19.516Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a4/be/c624d4241484f37dc62839e177ab607a9b8b3e96f0866544ca99e8e41d51/mypy-2.3.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:94f04929f1c44c35fb0061e912087edaf504acede963a4a7d00680bd089d8531", size = 13936739, upload-time = "2026-08-15T03:03:26.475Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/53/84/e3cf72f90dce5960871c82551c8fba6da05fc1018f79be41c047bd126bdd/mypy-2.3.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f5d716048611e85ca9eefb2e1baa5d73ede389b5820ded260ea27c757d667af8", size = 14166460, upload-time = "2026-08-15T03:01:50.565Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4a/ff/6b97d58aa0f79a5ab9b472db1f6d6df1b11a51d74d0c08ab3760d3a613ba/mypy-2.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b091a455111214cb5c9d54a57b9618e9a49f9fe2a42e4e1ac86e9d104ed96ce8", size = 15100476, upload-time = "2026-08-15T03:03:12.079Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/da/f0/cbb4b7d2ae3ac635f6b4f2d9b04070b8a92edf50da599d3b39e5ed109001/mypy-2.3.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:df12e20c9efd614738c71b390007ecd0181125afc4ccafca04d78a1d2eed2c01", size = 15347826, upload-time = "2026-08-15T03:03:02.856Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/85/da/d6effc4f808a842d91edc22535dc9e799d2ff6e91449168b7f47a0771f54/mypy-2.3.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a32bbbb940af990d3be0b8af321c7b6815bb1b3b48142fe7459b9cc5f58959ff", size = 14047547, upload-time = "2026-08-15T03:02:57.707Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e4/e6/478229701dab76f26485fc8ff5d6f241f393da22447400bbc56f6946aebe/mypy-2.3.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ff715e45b2231a8e85de1d163d1b42791e4d7aab8f5145f85fee1b710b735aff", size = 14216515, upload-time = "2026-08-15T03:01:26.496Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/fe/7c42327a3b21e84681f691982cbfe43f334a3685f3b683b72c376476c4fa/mypy-2.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:858fc57d3d91fa728e33e7ad71def60fc6272694607b306cd3292db53ae39080", size = 15307789, upload-time = "2026-08-15T03:03:31.62Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/59/f4/7e597edbe01b5a56fa958ce541302dcaabfed979966f1dffedbea0ea0fc2/mypy-2.3.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:851833db876e7b650f93719c74b7879a08e338979c96054fdfc3bfd90a486355", size = 15548831, upload-time = "2026-08-15T03:03:15.55Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/de/cf/862010ee800ca9c2bd0c4c0dacf0f092e5411824a09b8f97ad4be8fe250e/mypy-2.3.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:114dff494000f18bd10d5d95d84b8567b26da60279ecbe838131841df20e635d", size = 13964542, upload-time = "2026-08-15T03:02:21.43Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/75/5a/3f3a2107b41e3e92e617e25daaee121413b91e9784bea733131ed4fecc5d/mypy-2.3.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c8637731bb5eee3671eb2c3200827aa3564ed8a9309ecee4d1afe77e6d031bdb", size = 14168922, upload-time = "2026-08-15T03:03:00.351Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8b/41/04dc4fe7e63d7820fa4eff272e95157d30cbea921388f3ab3fe77794cd0b/mypy-2.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c80fbc405ed8020f5ff3802dc18cf060197bcdd3fbdd6a26ef2fd34dfdd5226", size = 15244791, upload-time = "2026-08-15T03:02:31.089Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/96/fc/c3053b26b9054949285aa868cb6af8c10e7591541cacd79c5dcc06a1fcf9/mypy-2.3.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:84081f538ce27375045c02e3d7f81bd11d853400621ae245d87ce7b6c420ec74", size = 15501627, upload-time = "2026-08-15T03:03:34.128Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/be/c4/42a49d44aeff804edf1b19acce0b49e8bd1a9c57dee9605dd8d980aa43d7/mypy-2.3.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:192abaedf75da1bc0b1cef104927e70ec49c1ef0031cc4825c7ee10a438ed24d", size = 13986778, upload-time = "2026-08-15T03:01:33.69Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/45/13/9331fd2dfed7194d66c5304072894a8be3e51e9deda6863c1eceaa35a43d/mypy-2.3.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bf678dffd16efcda2c15cbd30e9ecc0081388e29ea23687a88e686ed92638dc3", size = 14188467, upload-time = "2026-08-15T03:02:40.554Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/78/f7/f4a34edab45667c5465855dc585a20e87978ffa8aee711445b7239d120c6/mypy-2.3.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e036f06b41630f4c8a1d48f9ac6aa26acc65f8be089973f5519da643318f03f", size = 15225538, upload-time = "2026-08-15T03:03:09.761Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/40/05/534b3590757bd05794f73e07f6666c2a77b8597ffed795c94ce570096aa0/mypy-2.3.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:71af9c8a894e862b58e92abb08e53b05a384a1e5e5d6dc7cda59126211a53d82", size = 15480805, upload-time = "2026-08-15T03:01:41.134Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/55/da/bdfba852e2562f599624af5bb7d29e36b0b4f526f2b8bac85efe0dd1803d/mypy-2.3.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:3c80cd23d85368bdd9f37d5231dfd97d35bcbf5bf41af96ef3a9b078ad1957f9", size = 7761712, upload-time = "2026-08-15T03:02:36.008Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/82/c7/f80f4e46c0b9a00eb5f78a79d49dda8bdf56a5230f7257fb33e76be04da7/mypy-2.3.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:e5f1c50bb05b64e2026b52867e8d21106f01313c744a2c4ecc34c90d12e8d6e2", size = 15121308, upload-time = "2026-08-15T03:01:46.053Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5d/74/9b04f17c7074cc5188f02fb63a2ca1d43fedf479e84fe3091c39061a1d7f/mypy-2.3.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:667196b352f4cf304ded4c10f90cfc179263a1acfb3cdcfa984bdfd340d498bc", size = 15536590, upload-time = "2026-08-15T03:01:35.941Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/26/04/c837ef6208e567774e2ed1f863f8ba6ec4817b1b6dd426315e5d559b6ec9/mypy-2.3.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b9c53e395c12cad2c6d4b67d5da7c6057638a132d85c08b73646b18f802a0045", size = 16791074, upload-time = "2026-08-15T03:01:31.073Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/37/68/48730230afa45192d5bd429a6a2ff24a6f8dedda90fdf2b221792b54518f/mypy-2.3.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:18162b128c3f9c703cd35f5537446900b0d21a2549aa7a95d21380d2ef643fb0", size = 17069183, upload-time = "2026-08-15T03:02:28.566Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ee/f7/41e7f2d8117fbc7a7587286162ffe2f688984b69c46ed63cf5f2e4fc3bae/mypy-2.3.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:6f041a6de52c9217ca125e78ba0a335cb7fd98a1c0580978e49ab2b126f70b57", size = 13990694, upload-time = "2026-08-15T03:03:21.919Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/06/85/8f665811a0c8f3bf6fa1d9acd665ec2d97a2bcc453ae68dcd92340941cd6/mypy-2.3.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5159ae60f5dbc3a498af5ba8365505808ac8031bc63f9e00304ad545d40bdd9b", size = 14203518, upload-time = "2026-08-15T03:01:48.455Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2d/82/91b866c8546b120bff83b73a439d90d2d63ef3aff113599e6b8e4d566848/mypy-2.3.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:47a8a7a0a7f6f6e63995c0ac36fa0c07b127413fdc81f0439b7f3dccafd33561", size = 15220224, upload-time = "2026-08-15T03:01:23.577Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c8/78/c226c99208ee40de7c768369fa533f933afa003dfdc606ff021450724e91/mypy-2.3.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:2329c0501293d4e1f33bc15d04d6304d65a1cdda967ee93a05c1e681a3923133", size = 15501512, upload-time = "2026-08-15T03:02:09.453Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a9/e7/7cfb3f106c393979f4cc37ad6c0586044d50401e3c35b0c003e4f3ba6bc9/mypy-2.3.1-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:bb26deed807bdb0457cf3e3f1cd7c4a1cf9d66864eaf1b4a61e06805d4c6b1f9", size = 7761913, upload-time = "2026-08-15T03:01:55.65Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/10/ce/53be21f2d4adfcd26f63f1184a13ed797015ab463853f117e2e11e4d726f/mypy-2.3.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:ef0c6335cda9d807f8193d8ff6204a72bc909fa9882aacbca14f43cdb7188306", size = 15118669, upload-time = "2026-08-15T03:02:51.479Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/62/43/20de757cd42989d291a17fad607742c4c74e875ce5cea00e5a5225020ac1/mypy-2.3.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e598c8c66401d26b150872154a286e6d484cf2789c3bb28a7556806298423021", size = 15545627, upload-time = "2026-08-15T03:03:05.132Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/fc/092bdf77ad280eaf501422f0f3b966012b528076cc13e41a774861c907d1/mypy-2.3.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:eda22fd4efa9dcd39331d1dede9b5b8b8a7fd69af07592e778433da98610d29e", size = 16764157, upload-time = "2026-08-15T03:02:23.958Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/94/5c/c94c4d62d909b07f552d0d9356d7acc943825558e602a64822ffa2231536/mypy-2.3.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:2a0ba2e57847849fb0d1fcdabb32786d223095ed8bc121dfe322bcdb3d9c46bc", size = 17073258, upload-time = "2026-08-15T03:02:14.573Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8e/41/9675c7a1e78edecfba0b79e587a52594c56e189368261dc7b3a7fffb9527/mypy-2.3.1-py3-none-any.whl", hash = "sha256:6ed5c7e3419083268e5c9258bd1c1ef91af44a9e89374dbcaf37b775716e72eb", size = 2754338, upload-time = "2026-08-15T03:02:53.4Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2326,11 +2323,11 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "mypy-extensions"
|
||||
version = "1.2.0"
|
||||
version = "1.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d0/6f/43edf3be2748d0e40974a5ee046a8bb4c9961a4bdd3e7d5c6dcbf32d1af6/mypy_extensions-1.2.0.tar.gz", hash = "sha256:c6e275a07f1c2fc096b62940452d0eaa3f3af7de45d704787866240a7c6d5a51", size = 6566, upload-time = "2026-11-03T16:26:33.692Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b5/99/7b1adac7e97ce7bbda34792dc6e9b2f5cc5cffd1875883f78a818b2a2687/mypy_extensions-1.2.0-py3-none-any.whl", hash = "sha256:993e7a20aa5671eb41a7132cf555af30062da99729601601b9a8382b11cae768", size = 5114, upload-time = "2026-11-03T16:26:32.731Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2519,6 +2516,7 @@ dependencies = [
|
||||
{ name = "channels" },
|
||||
{ name = "channels-redis" },
|
||||
{ name = "concurrent-log-handler" },
|
||||
{ name = "cryptography" },
|
||||
{ name = "dateparser" },
|
||||
{ name = "django" },
|
||||
{ name = "django-allauth", extra = ["mfa", "socialaccount"] },
|
||||
@@ -2540,6 +2538,7 @@ dependencies = [
|
||||
{ name = "flower" },
|
||||
{ name = "gotenberg-client", extra = ["httpx"] },
|
||||
{ name = "httpx-oauth" },
|
||||
{ name = "humanize" },
|
||||
{ name = "ijson" },
|
||||
{ name = "imap-tools" },
|
||||
{ name = "jinja2" },
|
||||
@@ -2550,10 +2549,13 @@ dependencies = [
|
||||
{ name = "llama-index-embeddings-openai-like" },
|
||||
{ name = "llama-index-llms-ollama" },
|
||||
{ name = "llama-index-llms-openai-like" },
|
||||
{ name = "lxml" },
|
||||
{ name = "ocrmypdf", extra = ["heic"] },
|
||||
{ name = "ollama" },
|
||||
{ name = "openai" },
|
||||
{ name = "pathvalidate" },
|
||||
{ name = "pdf2image" },
|
||||
{ name = "pikepdf" },
|
||||
{ name = "python-dateutil" },
|
||||
{ name = "python-dotenv" },
|
||||
{ name = "python-gnupg" },
|
||||
@@ -2671,6 +2673,7 @@ requires-dist = [
|
||||
{ name = "channels", specifier = "~=4.2" },
|
||||
{ name = "channels-redis", specifier = "~=4.2" },
|
||||
{ name = "concurrent-log-handler", specifier = "~=0.9.25" },
|
||||
{ name = "cryptography", specifier = ">=50.0.0" },
|
||||
{ name = "dateparser", specifier = "~=1.4" },
|
||||
{ name = "django", specifier = "~=5.2.18" },
|
||||
{ name = "django-allauth", extras = ["mfa", "socialaccount"], specifier = "~=65.21.1" },
|
||||
@@ -2693,6 +2696,7 @@ requires-dist = [
|
||||
{ name = "gotenberg-client", extras = ["httpx"], specifier = "~=1.0" },
|
||||
{ name = "granian", extras = ["uvloop"], marker = "extra == 'webserver'", specifier = ">=2.7,<2.9" },
|
||||
{ name = "httpx-oauth", specifier = "~=0.17" },
|
||||
{ name = "humanize", specifier = ">=4.15.0" },
|
||||
{ name = "ijson", specifier = ">=3.5.1" },
|
||||
{ name = "imap-tools", specifier = ">=1.14,<1.16" },
|
||||
{ name = "jinja2", specifier = "~=3.1.6" },
|
||||
@@ -2703,11 +2707,14 @@ requires-dist = [
|
||||
{ name = "llama-index-embeddings-openai-like", specifier = ">=0.2.2" },
|
||||
{ name = "llama-index-llms-ollama", specifier = ">=0.9.1" },
|
||||
{ name = "llama-index-llms-openai-like", specifier = ">=0.7.1" },
|
||||
{ name = "lxml", specifier = ">=6.1.0" },
|
||||
{ name = "mysqlclient", marker = "extra == 'mariadb'", specifier = ">=2.2.7,<2.4" },
|
||||
{ name = "ocrmypdf", extras = ["heic"], specifier = ">=17.12,<17.13" },
|
||||
{ name = "ollama", specifier = ">=0.6.1" },
|
||||
{ name = "openai", specifier = ">=2.48" },
|
||||
{ name = "pathvalidate", specifier = "~=3.3.1" },
|
||||
{ name = "pdf2image", specifier = "~=1.17.0" },
|
||||
{ name = "pikepdf", specifier = ">=10.13" },
|
||||
{ name = "psycopg", extras = ["c", "pool"], marker = "extra == 'postgres'", specifier = "==3.3.8" },
|
||||
{ name = "psycopg-c", marker = "python_full_version == '3.12.*' and platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'postgres'", url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp312-cp312-manylinux_2_38_aarch64.whl" },
|
||||
{ name = "psycopg-c", marker = "python_full_version == '3.14.*' and platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'postgres'", url = "https://github.com/paperless-ngx/builder/releases/download/psycopg-trixie-3.3.8/psycopg_c-3.3.8-cp314-cp314-manylinux_2_38_aarch64.whl" },
|
||||
@@ -3349,15 +3356,15 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "pyrefly"
|
||||
version = "1.5.0"
|
||||
version = "1.3.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/6d/1f/8009dc6e412015a031d09c863df2aaa77ba01997aa39087cb3b0d0ab9780/pyrefly-1.5.0.tar.gz", hash = "sha256:46392760dfd8bf80d596d063699e4ac16a475ffc99706122f80d5edc95ec6ab1", size = 7747228, upload-time = "2026-11-19T01:21:16.444Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/4c/7e/082cc1b392318bacfbc087732524f3e089e9e7fe45b7645c4649b6f1f1e9/pyrefly-1.3.1.tar.gz", hash = "sha256:b774f1dfac82867fc16fe2175d80a630e2a72a6835d5b7e492568d6bfb6b05e7", size = 6679145, upload-time = "2026-09-15T05:09:34.49Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/81/cb/da637cf89bcf53c5efc71b154eb1c28c7f484178b1f11b8b89832cccd677/pyrefly-1.5.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e6a6e88d9df33fc74c1669f10e3b34b29713724e1985d6a499338c27366d86f3", size = 16090376, upload-time = "2026-11-19T01:20:30.706Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ee/a5/d97649a1a8309680aa12cf2a7dff83d98f21c505569a7aacac75e4508abb/pyrefly-1.5.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b2519ccfadee65d28b524cce9e5e80ec3493815a7063e136fd6c5ad2ad8b01d3", size = 16524809, upload-time = "2026-11-19T01:20:34.108Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/35/e7/7202653316924f73631d4e309f6e70bf300e16f3b3b20d6bf85a33a9917a/pyrefly-1.5.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e9fcc4ef2709eda35c5b8b262f204db2601ef619f983ce084f26627fdf641b01", size = 17422238, upload-time = "2026-11-19T01:20:55.729Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/99/6f/8c0998eb51c0ecd5f95ef2131733ae29c26b898b1efd5c530942bde4fa1c/pyrefly-1.5.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3fff600f7c43de627390e93e72c4a684c4748a2077feeb1534495d704c24ab85", size = 16770340, upload-time = "2026-11-19T01:21:00.074Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6a/6c/4200df3c896125c090086e2936f7a456d23528e4935208488a357992e7f5/pyrefly-1.5.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:de6f64c7932eaa45327106307dd1cc818f605ddca86545ed56342917420ba4d2", size = 17515449, upload-time = "2026-11-19T01:21:03.808Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/78/24/a31e7de8e0f310c9f0753826d0df8b6a8ff86793941a6bd88ba24b735633/pyrefly-1.3.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:37a1a1fb41e7190fe3964a877875dd809d6ee2887809e2c3d6e5f25a69805bfd", size = 14430773, upload-time = "2026-09-15T05:09:01.67Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/75/e1/022352beb186f36d6213a95a975c42676ee418ff5e730629378d25564c5e/pyrefly-1.3.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45b7650bc651a5a784701f2fb4f579da9a421c4d1b5fd91f9048f4529e46093c", size = 14877762, upload-time = "2026-09-15T05:09:04.767Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/19/d1/84f81b9e32288b5d11c75e006f67e0f6b78b85da575673bd1a21524c8172/pyrefly-1.3.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39d5a17c1ad655e5f93a6e8e0be90b8db28c6015fe07d6ed4e054891c9e14ef8", size = 15440062, upload-time = "2026-09-15T05:09:14.641Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/46/3c/2aa0c5ad6a2957a728bb38cfab70d1e9cafad21b0b1c1d92df74a3cf22bd/pyrefly-1.3.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c61e9dcf888beb81ca0e0c60ea4442640fdcf2f1f65bfe3d9f5d89b85516eb03", size = 14898534, upload-time = "2026-09-15T05:09:17.823Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/03/5d/2974f249fb2e285f966485719d977c5a2248cc4866403af94d935775ff15/pyrefly-1.3.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a78eed1c53f37807f0e2997be8edbe833b91eb9915f2cb553a1bdcd599e7105c", size = 15477758, upload-time = "2026-09-15T05:09:20.964Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
Reference in new issue
Block a user