Fixing starred story counts.

This commit is contained in:
Samuel Clay 2014-02-07 14:15:55 -08:00
parent 639060205d
commit 0b3e64232f
2 changed files with 6 additions and 1 deletions

View file

@ -2108,7 +2108,7 @@ class MStarredStoryCounts(mongo.Document):
def count_tags_for_user(cls, user_id):
all_tags = MStarredStory.objects(user_id=user_id,
user_tags__exists=True).item_frequencies('user_tags')
user_tags = sorted([(k, v) for k, v in all_tags.items() if int(v) > 0],
user_tags = sorted([(k, v) for k, v in all_tags.items() if int(v) > 0 and k],
key=itemgetter(1),
reverse=True)

View file

@ -6,11 +6,16 @@
#import <MobileCoreServices/MobileCoreServices.h>
//#define DEBUG 1
#define PROD_DEBUG 1
#ifdef DEBUG
#define BACKGROUND_REFRESH_SECONDS -5
#define NEWSBLUR_URL [NSString stringWithFormat:@"http://nb.local.com"]
#define NEWSBLUR_HOST [NSString stringWithFormat:@"nb.local.com"]
#elif PROD_DEBUG
#define BACKGROUND_REFRESH_SECONDS -10*60
#define NEWSBLUR_URL [NSString stringWithFormat:@"http://debug.newsblur.com"]
#define NEWSBLUR_HOST [NSString stringWithFormat:@"debug.newsblur.com"]
#else
#define BACKGROUND_REFRESH_SECONDS -10*60
#define NEWSBLUR_URL [NSString stringWithFormat:@"https://www.newsblur.com"]