Fixing shared_date for @secretsquirrel. Was inappropriately being converted to plain text date only for stories the user shared themselves.

This commit is contained in:
Samuel Clay 2012-08-14 12:28:52 -07:00
parent 8513f83d6d
commit 8432ba6918
2 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,6 @@
import sys
from django.db import models
from django.contrib.auth.models import User
from apps.rss_feeds.models import DuplicateFeed
from utils import log as logging
@ -26,6 +27,8 @@ class UserSubscriptionManager(models.Manager):
elif 'feed_id' in kwargs:
kwargs['feed_id'] = feed.pk
user = kwargs.get('user')
if isinstance(user, int):
user = User.objects.get(pk=user)
logging.debug(" ---> [%s] ~BRFound dupe UserSubscription: ~SB%s (%s)" % (user and user.username, feed, feed_id))
return super(UserSubscriptionManager, self).get(*args, **kwargs)
else:

View file

@ -141,9 +141,6 @@ def load_social_stories(request, user_id, username=None):
story['starred_date'] = format_story_link_date__long(starred_date, now)
if story['id'] in shared_stories:
story['shared'] = True
shared_date = localtime_for_timezone(shared_stories[story['id']]['shared_date'],
user.profile.timezone)
story['shared_date'] = format_story_link_date__long(shared_date, now)
story['shared_comments'] = strip_tags(shared_stories[story['id']]['comments'])
story['intelligence'] = {