Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made content take precedence over anything else

Content usually contains the full entry, summary and description are
truncated.
  • Loading branch information...
commit a1143bfbcc0b4ac24c3f5686660a6d8a62ae181d 1 parent 7e8c265
@brutasse brutasse 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 entry.has_key('updated_parsed'):
date_modified = datetime.datetime(*entry.updated_parsed[:6])

3 comments on commit a1143bf

@jezdez
Owner

I had to remove that after complaints of broken feeds.

@brutasse

@jezdez do you have examples of impacted feeds?

@jezdez
Owner

Mind jumping on IRC quick?

Please sign in to comment.
Something went wrong with that request. Please try again.