Merge pull request 'fix(news): drop future-dated items at ingest, hide them in /api/news' (#52) from wt/t_b8b8e927 into master
Some checks failed
build-and-deploy / build-push-deploy (push) Failing after 6s

This commit is contained in:
sirius 2026-11-14 02:43:23 +00:00
commit 58f71f5b45
5 changed files with 176 additions and 3 deletions

View file

@ -1293,7 +1293,12 @@ async def list_news(
):
"""Most recent scraped news articles (newest first)."""
async with async_session() as session:
stmt = select(articles).order_by(
stmt = select(articles).where(
or_(
articles.c.timestamp.is_(None),
articles.c.timestamp <= func.now(),
)
).order_by(
articles.c.timestamp.desc().nullslast()
)
if domain: