fix teg
This commit is contained in:
@@ -75,13 +75,15 @@ async def list_news(
|
||||
|
||||
if date_from:
|
||||
try:
|
||||
base = base.where(Article.published_at >= datetime.fromisoformat(date_from))
|
||||
dt = datetime.fromisoformat(date_from.replace("Z", "+00:00"))
|
||||
base = base.where(Article.published_at >= dt.replace(tzinfo=None))
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
if date_to:
|
||||
try:
|
||||
base = base.where(Article.published_at <= datetime.fromisoformat(date_to))
|
||||
dt = datetime.fromisoformat(date_to.replace("Z", "+00:00"))
|
||||
base = base.where(Article.published_at <= dt.replace(tzinfo=None))
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user