Adding checks for feed in trainer, now that the trainer is doing double-duty for individual feeds and for the trainer itself.

This commit is contained in:
Samuel Clay 2010-09-21 19:07:36 -04:00
parent 744745b3ee
commit 4ea886be15
3 changed files with 9 additions and 4 deletions

View file

@ -546,7 +546,7 @@ def save_feed_order(request):
@json.json_view
def get_feeds_trainer(request):
classifiers = []
feed_id = request.POST['feed_id']
feed_id = request.POST.get('feed_id')
usersubs = UserSubscription.objects.filter(user=request.user)
if feed_id:

View file

@ -202,11 +202,14 @@ NEWSBLUR.AssetModel.Reader.prototype = {
get_feeds_trainer: function(feed_id, callback) {
var self = this;
var params = {};
if (feed_id) {
params['feed_id'] = feed_id;
}
if (NEWSBLUR.Globals.is_authenticated) {
this.make_request('/reader/get_feeds_trainer', {
'feed_id': feed_id
}, callback, null, {'ajax_group': 'feed'});
this.make_request('/reader/get_feeds_trainer', params, callback, null, {'ajax_group': 'feed'});
} else {
if ($.isFunction(callback)) callback();
}

View file

@ -135,6 +135,8 @@ var classifier = {
var trainer_data_length = this.trainer_data.length;
var trainer_data = this.trainer_data[this.trainer_iterator];
this.feed_id = trainer_data['feed_id'];
this.trainer_iterator = this.trainer_iterator + 1;
if (this.trainer_iterator > trainer_data_length) {
this.make_trainer_outro();