Many bug fixes
This commit is contained in:
@@ -37,24 +37,28 @@ def get_description(article_object):
|
||||
except:
|
||||
news_article = fallback
|
||||
|
||||
|
||||
if news_article.title:
|
||||
title = news_article.title
|
||||
else:
|
||||
title = fallback.title
|
||||
|
||||
|
||||
if news_article.summary:
|
||||
summary = news_article.summary
|
||||
elif news_article.text:
|
||||
ind = min(500, len(news_article.text))
|
||||
summary = news_article.text[:ind] + "..."
|
||||
else:
|
||||
summary = fallback.summary
|
||||
summary = fallback.summary
|
||||
|
||||
if news_article.meta_lang:
|
||||
lang = news_article.meta_lang
|
||||
else:
|
||||
lang = ""
|
||||
|
||||
article_object.title = title
|
||||
article_object.summary = summary
|
||||
article_object.language = lang
|
||||
article_object.set_authors(news_article.authors)
|
||||
article_object.set_keywords(news_article.keywords)
|
||||
|
||||
|
||||
return article_object
|
||||
|
Reference in New Issue
Block a user