aboutsummaryrefslogtreecommitdiff
path: root/src/web/lib/article_utils.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-11-11 23:39:36 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-11-11 23:39:36 +0100
commit4e986a80fdaf2a4db8988f1eeb699e2d008ac3da (patch)
tree837b7a5e7d36aea1fcf8241ba7134a82e6e12a67 /src/web/lib/article_utils.py
parentAdded a template for articles of public feeds. (diff)
downloadnewspipe-4e986a80fdaf2a4db8988f1eeb699e2d008ac3da.tar.gz
newspipe-4e986a80fdaf2a4db8988f1eeb699e2d008ac3da.tar.bz2
newspipe-4e986a80fdaf2a4db8988f1eeb699e2d008ac3da.zip
Safef way to get the tags.
Diffstat (limited to 'src/web/lib/article_utils.py')
-rw-r--r--src/web/lib/article_utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/web/lib/article_utils.py b/src/web/lib/article_utils.py
index 81a0b145..2c5ea8c3 100644
--- a/src/web/lib/article_utils.py
+++ b/src/web/lib/article_utils.py
@@ -52,7 +52,8 @@ async def construct_article(entry, feed, fields=None, fetch=True):
#push_in_article('content', clean_urls(article['content'], link))
push_in_article('content', article['content'])
push_in_article('tags', {tag.get('term').strip()
- for tag in entry.get('tags', [])})
+ for tag in entry.get('tags', []) \
+ if tag and tag.get('term', False)})
return article
bgstack15