diff --git a/apps/rss_feeds/models.py b/apps/rss_feeds/models.py index d0dbb3e8c..683cfa043 100644 --- a/apps/rss_feeds/models.py +++ b/apps/rss_feeds/models.py @@ -1094,17 +1094,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') @@ -1130,7 +1130,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 diff --git a/apps/social/views.py b/apps/social/views.py index 83ba4ccaa..acb14f8d3 100644 --- a/apps/social/views.py +++ b/apps/social/views.py @@ -370,8 +370,8 @@ def load_social_page(request, user_id, username=None, **kwargs): 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]