Behebe die fehlschlagenden Paperless-Tests und lasse test.yml nur noch nach dem Dev-Deploy laufen.
Deploy Development / deploy (push) Successful in 52s

Der Hinweis zu Tags und Zusatzfeld sitzt wieder in paperless_documents, damit die Signatur von _paperless_get bleibt. Der Push-Trigger entfällt, weil er einen zweiten Lauf auf derselben Testdatenbank startete.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
StommerandClaude Sonnet 5.5 committed 2026-10-25 07:29:45 +01:00
1 parent 6e1b0916a6
commit bee48bf4a5
4 files changed
+32 -17

No files matched your search

+9 -6
View File
@@ -418,9 +418,13 @@ def paperless_documents(conn, owner_id: UUID, query: str, connector_id: UUID | N
names = _paperless_lookup(row["id"], base, row["secret"])
params = _paperless_params(query, options, names["custom_fields"])
# Observed on a real instance: all-tags together with a custom field makes Paperless answer 500.
clash = "," in params.get("tags__id__all", "") and "custom_field_query" in params
hint = "Das tritt auf, wenn „Alle gewählten Tags“ mit einem Zusatzfeld zusammentrifft. Wähle „Mindestens eines“ oder lass das Zusatzfeld weg." if clash else ""
payload = _paperless_get(base, row["secret"], "/api/documents/", params, hint)
try:
payload = _paperless_get(base, row["secret"], "/api/documents/", params)
except Problem as problem:
clash = "," in params.get("tags__id__all", "") and "custom_field_query" in params
if clash and "HTTP 5" in problem.detail:
raise unprocessable(f"{problem.detail} Das tritt auf, wenn „Alle gewählten Tags“ mit einem Zusatzfeld zusammentrifft. Wähle „Mindestens eines“ oder lass das Zusatzfeld weg.") from problem
raise
assert_still_owned(conn, row["id"], owner_id)
terms = _search_terms(query, (options or {}).get("title"))
items = []
@@ -1008,7 +1012,7 @@ def _filename(disposition: str | None) -> str:
return value.replace("\\", "").replace("/", "")[:180]
def _paperless_get(base: str, token: str, path: str, params: dict, hint: str = "") -> dict:
def _paperless_get(base: str, token: str, path: str, params: dict) -> dict:
url = f"{base}{path}?{urlencode(params)}"
request = Request(url, headers={"Authorization": f"Token {token}", "Accept": "application/json"})
try:
@@ -1017,8 +1021,7 @@ def _paperless_get(base: str, token: str, path: str, params: dict, hint: str = "
except HTTPError as exc:
if exc.code in {401, 403}:
raise unprocessable("Paperless hat den Schlüssel abgelehnt.") from exc
advice = f" {hint}" if hint and exc.code >= 500 else ""
raise unprocessable(f"Paperless hat die Anfrage nicht beantwortet ({_refusal(exc, path)}).{advice}") from exc
raise unprocessable(f"Paperless hat die Anfrage nicht beantwortet ({_refusal(exc, path)}).") from exc
except (URLError, TimeoutError, json.JSONDecodeError) as exc:
raise unprocessable("Paperless ist nicht erreichbar.") from exc