mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Adding premiums to munin. Fixing a few missing feeds bugs. These have to be addressed categorically, but for now, just pass on the bad ones.
This commit is contained in:
parent
56cff2fe96
commit
22570cf4c8
4 changed files with 10 additions and 7 deletions
|
@ -5,6 +5,7 @@ from django.contrib.auth.models import User
|
|||
from django.db.models.signals import post_save
|
||||
from django.core.mail import mail_admins
|
||||
from apps.reader.models import UserSubscription
|
||||
from apps.rss_feeds.models import Feed
|
||||
from paypal.standard.ipn.signals import subscription_signup
|
||||
from utils import log as logging
|
||||
|
||||
|
@ -30,7 +31,7 @@ class Profile(models.Model):
|
|||
try:
|
||||
sub.save()
|
||||
sub.feed.setup_feed_for_premium_subscribers()
|
||||
except IntegrityError:
|
||||
except IntegrityError, Feed.DoesNotExist:
|
||||
pass
|
||||
|
||||
logging.info(' ---> [%s] NEW PREMIUM ACCOUNT! WOOHOO!!! %s subscriptions!' % (self.user.username, subs.count()))
|
||||
|
|
|
@ -622,7 +622,7 @@ def save_feed_chooser(request):
|
|||
activated = 0
|
||||
usersubs = UserSubscription.objects.filter(user=request.user)
|
||||
for sub in usersubs:
|
||||
if sub.feed.pk in approved_feeds:
|
||||
if sub.feed and sub.feed.pk in approved_feeds:
|
||||
sub.active = True
|
||||
activated += 1
|
||||
sub.save()
|
||||
|
|
|
@ -2360,11 +2360,11 @@
|
|||
$.make('div', { className: 'NB-menu-manage-title' }, 'Intelligence Trainer'),
|
||||
$.make('div', { className: 'NB-menu-manage-subtitle' }, 'Accurate filters are happy filters.')
|
||||
]),
|
||||
$.make('li', { className: 'NB-menu-manage-preferences' }, [
|
||||
$.make('div', { className: 'NB-menu-manage-image' }),
|
||||
$.make('div', { className: 'NB-menu-manage-title' }, 'Preferences'),
|
||||
$.make('div', { className: 'NB-menu-manage-subtitle' }, 'Defaults and options.')
|
||||
]),
|
||||
// $.make('li', { className: 'NB-menu-manage-preferences' }, [
|
||||
// $.make('div', { className: 'NB-menu-manage-image' }),
|
||||
// $.make('div', { className: 'NB-menu-manage-title' }, 'Preferences'),
|
||||
// $.make('div', { className: 'NB-menu-manage-subtitle' }, 'Defaults and options.')
|
||||
// ]),
|
||||
(show_chooser && $.make('li', { className: 'NB-menu-manage-feedchooser' }, [
|
||||
$.make('div', { className: 'NB-menu-manage-image' }),
|
||||
$.make('div', { className: 'NB-menu-manage-title' }, 'Choose Your 64'),
|
||||
|
|
|
@ -12,6 +12,7 @@ graph_config = {
|
|||
'all.label': 'all',
|
||||
'monthly.label': 'monthly',
|
||||
'daily.label': 'daily',
|
||||
'premium.label': 'premium',
|
||||
}
|
||||
|
||||
last_month = datetime.datetime.utcnow() - datetime.timedelta(days=30)
|
||||
|
@ -21,6 +22,7 @@ metrics = {
|
|||
'all': User.objects.count(),
|
||||
'monthly': Profile.objects.filter(last_seen_on__gte=last_month).count(),
|
||||
'daily': Profile.objects.filter(last_seen_on__gte=last_day).count(),
|
||||
'premium': Profile.objects.filter(is_premium=True).count(),
|
||||
}
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Reference in a new issue