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"))
|
newspapers= list(db.query("select * from newspapers order by id desc limit 10"))
|
||||||
except IndexError:
|
except IndexError:
|
||||||
pass
|
pass
|
||||||
|
articles = []
|
||||||
for newspaper in newspapers:
|
for newspaper in newspapers:
|
||||||
|
|
||||||
|
|
||||||
articles = json.loads(newspaper['articles_json'])
|
articles += json.loads(newspaper['articles_json'])
|
||||||
if articles:
|
if len(articles) > 30:
|
||||||
for article in articles:
|
for article in articles:
|
||||||
for key, value in article.items():
|
for key, value in article.items():
|
||||||
article[key] = str(value).strip()
|
article[key] = str(value).strip().replace(' ', '')
|
||||||
return templates.TemplateResponse("newspaper_view.html", {
|
return templates.TemplateResponse("newspaper_view.html", {
|
||||||
"request": request,
|
"request": request,
|
||||||
"newspaper": newspaper,
|
"newspaper": newspaper,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user