generated from john/python-template
Remove references to "v4" throughout the code and documentation
Quality Gate / gate (push) Failing after 11s
Quality Gate / gate (push) Failing after 11s
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Additive V4 API routes for relationship and classification registries."""
|
||||
"""API routes for relationship and classification registries."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -20,7 +20,7 @@ from transcription.db.models import PersonRole
|
||||
from transcription.services import DocumentService
|
||||
from transcription.services import PeopleService
|
||||
|
||||
router = APIRouter(prefix="/api/v4", tags=["v4-documents"])
|
||||
router = APIRouter(prefix="/api", tags=["documents"])
|
||||
|
||||
|
||||
class ApiModel(BaseModel):
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Safe media route for V4.4 Document print previews."""
|
||||
"""Safe media route for Document print previews."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -15,7 +15,7 @@ from fastapi.responses import FileResponse
|
||||
from transcription.services.source_media import SOURCE_MIME_TYPES
|
||||
from transcription.services.sources import SourceService
|
||||
|
||||
router = APIRouter(prefix="/api/v4", tags=["v4-print"])
|
||||
router = APIRouter(prefix="/api", tags=["print"])
|
||||
|
||||
|
||||
def get_source_service(request: Request) -> SourceService:
|
||||
@@ -15,9 +15,9 @@ from fastapi.responses import RedirectResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
from .api.errors import register_error_handlers
|
||||
from .api.documents_api import router as documents_router
|
||||
from .api.health import router as health_router
|
||||
from .api.v4_documents import router as v4_documents_router
|
||||
from .api.v4_print import router as v4_print_router
|
||||
from .api.print_api import router as print_router
|
||||
from .config import Settings
|
||||
from .config import configure_logging
|
||||
from .config import get_settings
|
||||
@@ -100,7 +100,7 @@ def create_app(settings: Settings | None = None) -> FastAPI:
|
||||
|
||||
register_error_handlers(app)
|
||||
app.include_router(health_router)
|
||||
app.include_router(v4_documents_router)
|
||||
app.include_router(v4_print_router)
|
||||
app.include_router(documents_router)
|
||||
app.include_router(print_router)
|
||||
register_pages(app)
|
||||
return app
|
||||
|
||||
@@ -391,7 +391,7 @@ class JobService(ServiceBase):
|
||||
suggestion="Cancel processing first, then resubmit remaining sources.",
|
||||
)
|
||||
|
||||
# Cancelled pages are re-attemptable: before V4.7 cancel wrote FAILED,
|
||||
# Cancelled pages are re-attemptable: older flows wrote FAILED,
|
||||
# so resubmit already reset them. Excluding CANCELLED here would make
|
||||
# cancelled work permanently unrecoverable.
|
||||
resubmittable = {JobSourceStatus.FAILED, JobSourceStatus.CANCELLED}
|
||||
|
||||
@@ -63,7 +63,7 @@ def normalize_orientation(content: bytes, *, media_type: str) -> OrientationNorm
|
||||
except (OSError, ValueError, UnidentifiedImageError):
|
||||
# Undecodable content is not this function's business to reject. Ingest
|
||||
# accepted such bytes before orientation moved here, and decision A
|
||||
# forbids V4.7 changing what an upload does.
|
||||
# forbids changing what an upload does.
|
||||
logger.info("Skipped orientation normalization for undecodable content (%s)", media_type)
|
||||
return None
|
||||
try:
|
||||
|
||||
@@ -22,7 +22,7 @@ _HTML_ENTITY_RE = re.compile(r"&(?:#[0-9]{1,7}|#x[0-9a-f]{1,6}|[a-z][a-z0-9]{1,3
|
||||
|
||||
|
||||
class QualityWarningCode(StrEnum):
|
||||
"""Stable identifiers for V4.5 output warning rules."""
|
||||
"""Stable identifiers for output warning rules."""
|
||||
|
||||
REPLACEMENT_CHARACTER = "replacement_character"
|
||||
MULTIPLE_BODY_MARKERS = "multiple_body_markers"
|
||||
|
||||
@@ -100,7 +100,7 @@ def _render_print_document(projection: DocumentPrintProjection, *, mode: str) ->
|
||||
|
||||
def _render_facsimile_source(*, document_id: UUID, source: DocumentPrintSource, text: str) -> None:
|
||||
with ui.row().classes("print-facsimile-row w-full items-start gap-4"):
|
||||
media_url = f"/api/v4/documents/{document_id}/sources/{source.id}/media"
|
||||
media_url = f"/api/documents/{document_id}/sources/{source.id}/media"
|
||||
if source.media_type == "application/pdf":
|
||||
ui.element("iframe").props(f'src="{media_url}" title="Source page {source.page_number}"').classes(
|
||||
"print-source-pdf"
|
||||
|
||||
Reference in New Issue
Block a user