Removing story blurblog permalink, making it called explicitly.

This commit is contained in:
Samuel Clay 2013-05-14 16:36:03 -07:00
parent 43ab118a21
commit 7068119208
2 changed files with 5 additions and 5 deletions

View file

@ -1091,17 +1091,17 @@ class Feed(models.Model):
return stories
@classmethod
def format_stories(cls, stories_db, feed_id=None):
def format_stories(cls, stories_db, feed_id=None, include_permalinks=False):
stories = []
for story_db in stories_db:
story = cls.format_story(story_db, feed_id)
story = cls.format_story(story_db, feed_id, include_permalinks=include_permalinks)
stories.append(story)
return stories
@classmethod
def format_story(cls, story_db, feed_id=None, text=False):
def format_story(cls, story_db, feed_id=None, text=False, include_permalinks=False):
if isinstance(story_db.story_content_z, unicode):
story_db.story_content_z = story_db.story_content_z.decode('base64')
@ -1127,7 +1127,7 @@ class Feed(models.Model):
story['starred_date'] = story_db.starred_date
if hasattr(story_db, 'shared_date'):
story['shared_date'] = story_db.shared_date
if hasattr(story_db, 'blurblog_permalink'):
if include_permalinks and hasattr(story_db, 'blurblog_permalink'):
story['blurblog_permalink'] = story_db.blurblog_permalink()
if text:
from BeautifulSoup import BeautifulSoup

View file

@ -338,7 +338,7 @@ def load_social_page(request, user_id, username=None, **kwargs):
if feed_id:
params['story_feed_id'] = feed_id
mstories = MSharedStory.objects(**params).order_by('-shared_date')[offset:offset+limit+1]
stories = Feed.format_stories(mstories)
stories = Feed.format_stories(mstories, include_permalinks=True)
if len(stories) > limit:
has_next_page = True
stories = stories[:-1]