use summary if it's available and content isn't

This commit is contained in:
Kyle Mahan 2016-04-22 18:29:40 -07:00
parent 10069b0eb1
commit 2616816a24
2 changed files with 7 additions and 1 deletions

View file

@ -18,7 +18,7 @@ itsdangerous==0.24
Jinja2==2.8
MarkupSafe==0.23
mf2py==1.0.4
mf2util==0.3.3
-e git+https://github.com/kylewm/mf2util.git@master#egg=mf2util-master
psycopg2==2.6.1
pyasn1==0.1.9
pycparser==2.14

View file

@ -474,6 +474,12 @@ def hentry_to_entry(hentry, feed, backfill, now):
title = hentry.get('name')
content = hentry.get('content')
summary = hentry.get('summary')
if not content and summary:
content = '{}<br/><br/><a href="{}">Read more</a>'.format(
summary, permalink)
if not content and hentry.get('type') == 'entry':
content = title
title = None