Mache große IMAP-Fächer, die Paperless-Suche und die interne Markdown-Notiz über die gemeinsamen Schnittstellen benutzbar.
Deploy Development / deploy (push) Successful in 41s
Test Suite / pytest-backend (push) Failing after 2m55s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 23s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-20 07:34:14 +02:00
1 parent c3a07cee64
commit 7e39fbb2bd
29 files changed
+6053 -320

No files matched your search

+3 -24
View File
@@ -7,12 +7,11 @@ from __future__ import annotations
from uuid import UUID
from app.access.policy import mediated_source_owner
from app.core.errors import not_found, unprocessable
from app.retrieval import FilePayload, RetrievalFailure
from app.sourcebind import resolve_for_read
from app.sourceregistry import SourceModule, register_source, unregister_source
from app.sources import ORIGINAL_UNAVAILABLE, _audit_mediated, _connector_owner
from app.sourceaccess import borrow_original, complete_borrow
KIND = "sample"
@@ -88,28 +87,8 @@ def preview(conn, owner_id: UUID, connector_id: UUID, options: dict) -> dict:
def open_original(conn, actor_id: UUID, element: dict, context, ref) -> tuple[bytes, str, str]:
external_id = str((ref or {}).get("external_id") or "")
stored = ref.get("connector_id") if ref else None
stored_owner = _connector_owner(conn, stored)
if element["owner_subject_id"] == actor_id or stored_owner == actor_id:
result = resolve_for_read(conn, actor_id, KIND, ref, None)
if result.row is None:
raise unprocessable(result.message)
return _bytes(result.row, external_id)
owner_id = mediated_source_owner(conn, actor_id, element, context)
if owner_id is None:
raise unprocessable(ORIGINAL_UNAVAILABLE)
result = resolve_for_read(conn, owner_id, KIND, ref, None)
if result.row is None:
_audit_mediated(conn, actor_id, element, context, KIND, stored, "unavailable")
raise unprocessable(ORIGINAL_UNAVAILABLE)
try:
data, media, name = _bytes(result.row, external_id)
except Exception:
_audit_mediated(conn, actor_id, element, context, KIND, result.row["id"], "unavailable")
raise unprocessable(ORIGINAL_UNAVAILABLE) from None
_audit_mediated(conn, actor_id, element, context, KIND, result.row["id"], "ok")
return data, media, name
borrowed = borrow_original(conn, actor_id, element, context, ref, KIND)
return complete_borrow(conn, borrowed, lambda row: _bytes(row, borrowed.external_id))
def export_original(conn, actor_id: UUID, external_id: str, detail: dict, assigned, ref):