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
Some checks failed
build-and-deploy / build-push-deploy (push) Failing after 6s
This commit is contained in:
commit
58f71f5b45
5 changed files with 176 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue