diff --git a/web/src/padelnomics/admin/routes.py b/web/src/padelnomics/admin/routes.py index 3e2b11a..1a52512 100644 --- a/web/src/padelnomics/admin/routes.py +++ b/web/src/padelnomics/admin/routes.py @@ -2657,18 +2657,13 @@ async def articles_bulk(): from ..content.routes import BUILD_DIR rows = await fetch_all( - f"SELECT id, slug, article_type FROM articles WHERE {where} LIMIT 5000", + f"SELECT id, slug FROM articles WHERE {where} LIMIT 5000", tuple(where_params), ) for a in rows: build_path = BUILD_DIR / f"{a['slug']}.html" if build_path.exists(): build_path.unlink() - # Only remove source .md for generated articles - if a["article_type"] == "generated": - md_path = Path("data/content/articles") / f"{a['slug']}.md" - if md_path.exists(): - md_path.unlink() await execute(f"DELETE FROM articles WHERE {where}", tuple(where_params)) from ..sitemap import invalidate_sitemap_cache invalidate_sitemap_cache() @@ -2714,18 +2709,13 @@ async def articles_bulk(): from ..content.routes import BUILD_DIR articles_rows = await fetch_all( - f"SELECT id, slug, article_type FROM articles WHERE id IN ({placeholders})", + f"SELECT id, slug FROM articles WHERE id IN ({placeholders})", tuple(article_ids), ) for a in articles_rows: build_path = BUILD_DIR / f"{a['slug']}.html" if build_path.exists(): build_path.unlink() - # Only remove source .md for generated articles - if a["article_type"] == "generated": - md_path = Path("data/content/articles") / f"{a['slug']}.md" - if md_path.exists(): - md_path.unlink() await execute( f"DELETE FROM articles WHERE id IN ({placeholders})", tuple(article_ids), @@ -2951,14 +2941,10 @@ async def article_delete(article_id: int): """Delete an article.""" article = await fetch_one("SELECT slug FROM articles WHERE id = ?", (article_id,)) if article: - # Clean up files from ..content.routes import BUILD_DIR build_path = BUILD_DIR / f"{article['slug']}.html" if build_path.exists(): build_path.unlink() - md_path = Path("data/content/articles") / f"{article['slug']}.md" - if md_path.exists(): - md_path.unlink() await execute("DELETE FROM articles WHERE id = ?", (article_id,))