mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Fixing bug I've been tracking down for a while. Following an activity on a user you don't follow now correctly shows a tryfeed. Thanks to @afita for the great find!
This commit is contained in:
parent
c3dbe76e71
commit
2eec84fcac
4 changed files with 28 additions and 9 deletions
26
apps/social/migrations/0005_sharedstory_activity_userid.py
Normal file
26
apps/social/migrations/0005_sharedstory_activity_userid.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import datetime
|
||||
from south.db import db
|
||||
from south.v2 import DataMigration
|
||||
from django.db import models
|
||||
|
||||
from apps.social.models import MActivity
|
||||
|
||||
class Migration(DataMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
activities = MActivity.objects.filter(category='sharedstory', with_user_id__ne=True)
|
||||
print "Found %s activities missing sharedstory with_user." % activities.count()
|
||||
for activity in activities:
|
||||
activity.with_user_id = activity.user_id
|
||||
activity.save()
|
||||
|
||||
def backwards(self, orm):
|
||||
"Write your backwards methods here."
|
||||
|
||||
models = {
|
||||
|
||||
}
|
||||
|
||||
complete_apps = ['social']
|
||||
symmetrical = True
|
|
@ -2266,6 +2266,7 @@ class MActivity(mongo.Document):
|
|||
@classmethod
|
||||
def new_shared_story(cls, user_id, source_user_id, story_title, comments, story_feed_id, story_id, share_date=None):
|
||||
a, _ = cls.objects.get_or_create(user_id=user_id,
|
||||
with_user_id=user_id,
|
||||
category='sharedstory',
|
||||
feed_id="social:%s" % user_id,
|
||||
story_feed_id=story_feed_id,
|
||||
|
|
|
@ -215,15 +215,7 @@ _.extend(NEWSBLUR.ReaderSocialProfile.prototype, {
|
|||
$t.tipsy('hide').tipsy('disable');
|
||||
self.fetch_profile(user_id);
|
||||
});
|
||||
|
||||
$.targetIs(e, { tagSelector: '.NB-interaction-username, .NB-interaction-follow .NB-interaction-photo' }, function($t, $p){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var user_id = $t.data('userId');
|
||||
var username = $t.closest('.NB-interaction').find('.NB-interaction-username').text();
|
||||
self.model.add_user_profiles([{user_id: user_id, username: username}]);
|
||||
self.fetch_profile(user_id);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
Loading…
Add table
Reference in a new issue