fix: resolve post-merge test failures (group_key + i18n)

- Remove body_html from _sync_static_articles INSERT (no such column in articles table)
- Remove empty report_q1_stat*_unit keys from EN+DE locales (i18n parity test forbids empty values)
- Update report_landing.html to remove stats-strip__unit spans referencing deleted keys
- Fix 0020_articles_unique_url_language migration to preserve group_key when recreating articles table (migration clobbered the column added by the preceding 0020_articles_group_key migration)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Deeman
2026-02-27 08:23:49 +01:00
parent e1fbfdf40e
commit 9507767de1
5 changed files with 16 additions and 27 deletions

View File

@@ -2248,9 +2248,6 @@ async def _sync_static_articles() -> None:
if existing and existing["updated_at"] and existing["updated_at"] >= file_mtime_iso:
continue
body_md = raw[m.end():]
body_html = mistune.html(body_md)
title = fm.get("title", slug)
url_path = fm.get("url_path", f"/{slug}")
language = fm.get("language", "en")
@@ -2261,19 +2258,18 @@ async def _sync_static_articles() -> None:
await execute(
"""INSERT INTO articles
(slug, title, url_path, language, meta_description, body_html,
(slug, title, url_path, language, meta_description,
status, template_slug, group_key, created_at, updated_at)
VALUES (?, ?, ?, ?, ?, ?, 'draft', ?, ?, ?, ?)
VALUES (?, ?, ?, ?, ?, 'draft', ?, ?, ?, ?)
ON CONFLICT(slug) DO UPDATE SET
title = excluded.title,
url_path = excluded.url_path,
language = excluded.language,
title = excluded.title,
url_path = excluded.url_path,
language = excluded.language,
meta_description = excluded.meta_description,
body_html = excluded.body_html,
template_slug = excluded.template_slug,
group_key = excluded.group_key,
updated_at = excluded.updated_at""",
(slug, title, url_path, language, meta_description, body_html,
template_slug = excluded.template_slug,
group_key = excluded.group_key,
updated_at = excluded.updated_at""",
(slug, title, url_path, language, meta_description,
template_slug, group_key, now_iso, now_iso),
)

View File

@@ -1754,13 +1754,9 @@
"report_q1_meta_description": "77.355 Padelplätze weltweit, +29 % in 18 Monaten. Der umfassendste unabhängige Marktbericht zum globalen Padelmarkt — FIP, Playtomic/PwC und die Padelnomics-Datenpipeline.",
"report_q1_subtitle": "Das vollständigste unabhängige Bild des globalen Padelmarkts — Daten aus FIP, Playtomic/PwC und der Padelnomics-Pipeline mit 12.441 Standorten in 80 Ländern.",
"report_q1_stat1_label": "Plätze weltweit",
"report_q1_stat1_unit": "",
"report_q1_stat2_label": "Wachstum in 18 Monaten",
"report_q1_stat2_unit": "",
"report_q1_stat3_label": "Erfasste Länder",
"report_q1_stat3_unit": "",
"report_q1_stat4_label": "Venues im Datensatz",
"report_q1_stat4_unit": "",
"report_q1_toc_heading": "Im Bericht",
"report_q1_toc_1": "Globaler Überblick: Plätze, Spieler, Verbände",
"report_q1_toc_2": "Europa: eine ungleich verteilte Karte",

View File

@@ -1757,13 +1757,9 @@
"report_q1_meta_description": "77,355 padel courts worldwide, +29% in 18 months. The most complete independent market report on global padel — FIP, Playtomic/PwC, and the Padelnomics data pipeline.",
"report_q1_subtitle": "The most complete independent picture of the global padel market — synthesising data from FIP, Playtomic/PwC, and the Padelnomics pipeline of 12,441 venues across 80 countries.",
"report_q1_stat1_label": "Courts worldwide",
"report_q1_stat1_unit": "",
"report_q1_stat2_label": "Growth in 18 months",
"report_q1_stat2_unit": "",
"report_q1_stat3_label": "Countries tracked",
"report_q1_stat3_unit": "",
"report_q1_stat4_label": "Venues in pipeline",
"report_q1_stat4_unit": "",
"report_q1_toc_heading": "What's inside",
"report_q1_toc_1": "Global snapshot: courts, players, federations",
"report_q1_toc_2": "Europe: the uneven map",

View File

@@ -31,6 +31,7 @@ def up(conn) -> None:
seo_head TEXT,
created_at TEXT NOT NULL DEFAULT (datetime('now')),
updated_at TEXT,
group_key TEXT DEFAULT NULL,
UNIQUE(url_path, language)
)
""")
@@ -38,10 +39,10 @@ def up(conn) -> None:
INSERT INTO articles_new
(id, url_path, slug, title, meta_description, country, region,
og_image_url, status, published_at, template_slug, language,
date_modified, seo_head, created_at, updated_at)
date_modified, seo_head, created_at, updated_at, group_key)
SELECT id, url_path, slug, title, meta_description, country, region,
og_image_url, status, published_at, template_slug, language,
date_modified, seo_head, created_at, updated_at
date_modified, seo_head, created_at, updated_at, group_key
FROM articles
""")
conn.execute("DROP TABLE articles")

View File

@@ -27,19 +27,19 @@
<div class="stats-strip mb-8">
<div class="stats-strip__item">
<div class="stats-strip__label">{{ t.report_q1_stat1_label }}</div>
<div class="stats-strip__value">77,355<span class="stats-strip__unit">{{ t.report_q1_stat1_unit }}</span></div>
<div class="stats-strip__value">77,355</div>
</div>
<div class="stats-strip__item">
<div class="stats-strip__label">{{ t.report_q1_stat2_label }}</div>
<div class="stats-strip__value">+29%<span class="stats-strip__unit">{{ t.report_q1_stat2_unit }}</span></div>
<div class="stats-strip__value">+29%</div>
</div>
<div class="stats-strip__item">
<div class="stats-strip__label">{{ t.report_q1_stat3_label }}</div>
<div class="stats-strip__value">80<span class="stats-strip__unit">{{ t.report_q1_stat3_unit }}</span></div>
<div class="stats-strip__value">80</div>
</div>
<div class="stats-strip__item">
<div class="stats-strip__label">{{ t.report_q1_stat4_label }}</div>
<div class="stats-strip__value">12,441<span class="stats-strip__unit">{{ t.report_q1_stat4_unit }}</span></div>
<div class="stats-strip__value">12,441</div>
</div>
</div>