Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved date handling: use published date when available

  • Loading branch information...
commit 6a0a6ac31b9e4d05a71870ed9e4b15e0c444d0a7 1 parent a1143bf
@brutasse brutasse authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 django_website/aggregator/models.py
View
4 django_website/aggregator/models.py
@@ -138,7 +138,9 @@ def feed_updated(sender, notification, **kwargs):
for item in entry.content:
content += item.value
- if entry.has_key('updated_parsed'):
+ if 'published_parsed' in entry and entry.published_parsed is not None:
+ date_modified = datetime.datetime(*entry.published_parsed[:6])
+ elif 'updated_parsed' in entry and entry.updated_parsed is not None:
date_modified = datetime.datetime(*entry.updated_parsed[:6])
else:
date_modified = datetime.datetime.now()
Please sign in to comment.
Something went wrong with that request. Please try again.