Fixing errors on existing story search in feed fetching. Turns out it was using the wrong story_date to quickly determine if the story is new or not.

This commit is contained in:
Samuel Clay 2010-09-28 21:10:10 -04:00
parent 6260df43e9
commit a75417d917

View file

@ -508,12 +508,14 @@ class Feed(models.Model):
story_published_now = story.get('published_now', False)
start_date = story_pub_date - datetime.timedelta(hours=8)
end_date = story_pub_date + datetime.timedelta(hours=8)
existing_stories.rewind()
for existing_story in existing_stories:
content_ratio = 0
existing_story_pub_date = existing_story['story_date']
# print 'Story pub date: %s %s' % (story_published_now, story_pub_date)
if (story_published_now or
(story_pub_date > start_date and story_pub_date < end_date)):
(existing_story_pub_date > start_date and existing_story_pub_date < end_date)):
if isinstance(existing_story['_id'], unicode):
existing_story['story_guid'] = existing_story['_id']
if story.get('guid') and story.get('guid') == existing_story['story_guid']: