fix: URL persistence in export + cache-busting v4.8.0
Some checks failed
Build & Push Docker / build (push) Has been cancelled

- getDocument() now explicitly lists all block fields including url
- loadDocument() initializes url/series_id for backward compat with older JSONs
- Cache-busting query params (?v=4.8) on all static assets
- PDF generator uses block.url directly (proper model field)
- Added 7 new URL tests (model, API, PDF link annotations)
- Version bumped to 4.8.0
This commit is contained in:
Martin Sukany
2026-03-14 19:51:05 +01:00
parent 0a694ce63a
commit 04fe5590b0
7 changed files with 121 additions and 10 deletions

View File

@@ -185,3 +185,23 @@ def test_backward_compat_date_field(client):
r = client.post("/api/validate", json=doc)
assert r.status_code == 200
assert r.json()["valid"] is True
def test_generate_pdf_with_url_block(client):
"""PDF generation should succeed when blocks contain url field."""
doc = make_valid_doc()
doc["blocks"][0]["url"] = "https://example.com/linked"
r = client.post("/api/generate-pdf", json=doc)
assert r.status_code == 200
assert r.content[:5] == b'%PDF-'
# Verify link annotation is present in the PDF
assert b'example.com/linked' in r.content
def test_validate_accepts_url_field(client):
"""Blocks with or without url should both validate successfully."""
doc = make_valid_doc()
doc["blocks"][0]["url"] = "https://example.com"
r = client.post("/api/validate", json=doc)
assert r.status_code == 200
assert r.json()["valid"] is True