Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Revert "Made content take precedence over anything else""

This reverts commit 67d4a1d.
  • Loading branch information...
commit 2ae7722ab7bce6ab13e0bb24ed5f7a013f1ff5fe 1 parent 64d78d1
@jezdez jezdez authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 django_website/aggregator/models.py
View
15 django_website/aggregator/models.py
@@ -124,14 +124,19 @@ def feed_updated(sender, notification, **kwargs):
log.error("Feed ID %s has an entry ('%s') without a link or guid. Skipping.", feed.id, title)
link = getattr(entry, "link", guid)
+ content = u''
if hasattr(entry, "summary"):
content = entry.summary
- elif hasattr(entry, "content"):
- content = entry.content[0].value
- elif hasattr(entry, "description"):
+
+ if hasattr(entry, "description"):
content = entry.description
- else:
- content = u""
+
+ # 'content' takes precedence on anything else. 'summary' and
+ # 'description' are usually truncated so it's safe to overwrite them
+ if hasattr(entry, "content"):
+ content = u''
+ for item in entry.content:
+ content += item.value
if 'published_parsed' in entry and entry.published_parsed is not None:
date_modified = datetime.datetime(*entry.published_parsed[:6])
Please sign in to comment.
Something went wrong with that request. Please try again.