mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-05 18:33:18 +00:00
Chore: ruff 0.16 upgrade (#13531)
This commit is contained in:
@@ -300,7 +300,7 @@ def consumable_document_matches_workflow(
|
||||
]:
|
||||
reason = (
|
||||
f"Document source {document.source.name} not in"
|
||||
f" {[DocumentSource(int(x)).name for x in trigger.sources]}",
|
||||
f" {[DocumentSource(int(x)).name for x in trigger.sources]}"
|
||||
)
|
||||
trigger_matched = False
|
||||
|
||||
@@ -310,8 +310,7 @@ def consumable_document_matches_workflow(
|
||||
and document.mailrule_id != trigger.filter_mailrule.pk
|
||||
):
|
||||
reason = (
|
||||
f"Document mail rule {document.mailrule_id}"
|
||||
f" != {trigger.filter_mailrule.pk}",
|
||||
f"Document mail rule {document.mailrule_id} != {trigger.filter_mailrule.pk}"
|
||||
)
|
||||
trigger_matched = False
|
||||
|
||||
@@ -326,7 +325,7 @@ def consumable_document_matches_workflow(
|
||||
):
|
||||
reason = (
|
||||
f"Document filename {document.original_file.name} does not match"
|
||||
f" {trigger.filter_filename.lower()}",
|
||||
f" {trigger.filter_filename.lower()}"
|
||||
)
|
||||
trigger_matched = False
|
||||
|
||||
@@ -349,7 +348,7 @@ def consumable_document_matches_workflow(
|
||||
):
|
||||
reason = (
|
||||
f"Document path {document.original_file}"
|
||||
f" does not match {trigger.filter_path}",
|
||||
f" does not match {trigger.filter_path}"
|
||||
)
|
||||
trigger_matched = False
|
||||
|
||||
|
||||
@@ -341,9 +341,11 @@ class TestTranslateQuery:
|
||||
("tag:foo,type:bar", "tag:foo AND document_type:bar"),
|
||||
(
|
||||
"created:[2020 TO 2021],added:[2022 TO 2023]",
|
||||
"created:[2020-01-01T00:00:00Z TO 2022-01-01T00:00:00Z}"
|
||||
" AND "
|
||||
"added:[2022-01-01T00:00:00Z TO 2024-01-01T00:00:00Z}",
|
||||
(
|
||||
"created:[2020-01-01T00:00:00Z TO 2022-01-01T00:00:00Z}"
|
||||
" AND "
|
||||
"added:[2022-01-01T00:00:00Z TO 2024-01-01T00:00:00Z}"
|
||||
),
|
||||
),
|
||||
# correspondent is not multi-value: comma stays literal inside the value
|
||||
("correspondent:foo,bar", "correspondent:foo,bar"),
|
||||
|
||||
@@ -160,7 +160,7 @@ class TestDateLocalization:
|
||||
)
|
||||
def test_localize_date_raises_type_error_for_invalid_input(
|
||||
self,
|
||||
invalid_value: None | list[object] | dict[Any, Any] | Literal[1698330605],
|
||||
invalid_value: list[object] | dict[Any, Any] | Literal[1698330605] | None,
|
||||
) -> None:
|
||||
with pytest.raises(TypeError) as excinfo:
|
||||
localize_date(invalid_value, "medium", "en_US")
|
||||
|
||||
Reference in New Issue
Block a user