Update.
This commit is contained in:
parent
30c3821d98
commit
6c50385a06
@ -555,15 +555,15 @@ async def newspaper_latest(request: Request):
|
||||
newspapers= list(db.query("select * from newspapers order by id desc limit 10"))
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
articles = []
|
||||
for newspaper in newspapers:
|
||||
|
||||
|
||||
articles = json.loads(newspaper['articles_json'])
|
||||
if articles:
|
||||
articles += json.loads(newspaper['articles_json'])
|
||||
if len(articles) > 30:
|
||||
for article in articles:
|
||||
for key, value in article.items():
|
||||
article[key] = str(value).strip()
|
||||
article[key] = str(value).strip().replace(' ', '')
|
||||
return templates.TemplateResponse("newspaper_view.html", {
|
||||
"request": request,
|
||||
"newspaper": newspaper,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user