mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Adding missing feeds for users as part of cleanup.
This commit is contained in:
parent
7b8795af15
commit
068829f379
3 changed files with 14 additions and 1 deletions
|
@ -2,7 +2,7 @@ import datetime
|
||||||
from celery.task import Task
|
from celery.task import Task
|
||||||
from apps.profile.models import Profile, RNewUserQueue
|
from apps.profile.models import Profile, RNewUserQueue
|
||||||
from utils import log as logging
|
from utils import log as logging
|
||||||
from apps.reader.models import UserSubscription
|
from apps.reader.models import UserSubscription, UserSubscriptionFolders
|
||||||
from apps.social.models import MSocialServices, MActivity, MInteraction
|
from apps.social.models import MSocialServices, MActivity, MInteraction
|
||||||
|
|
||||||
class EmailNewUser(Task):
|
class EmailNewUser(Task):
|
||||||
|
@ -62,6 +62,7 @@ class CleanupUser(Task):
|
||||||
Profile.count_all_feed_subscribers_for_user(user_id)
|
Profile.count_all_feed_subscribers_for_user(user_id)
|
||||||
MInteraction.trim(user_id)
|
MInteraction.trim(user_id)
|
||||||
MActivity.trim(user_id)
|
MActivity.trim(user_id)
|
||||||
|
UserSubscriptionFolders.add_missing_feeds_for_user(user_id)
|
||||||
# UserSubscription.refresh_stale_feeds(user_id)
|
# UserSubscription.refresh_stale_feeds(user_id)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -1589,6 +1589,16 @@ class UserSubscriptionFolders(models.Model):
|
||||||
for i, f in enumerate(usf):
|
for i, f in enumerate(usf):
|
||||||
print "%s/%s: %s" % (i, total, f)
|
print "%s/%s: %s" % (i, total, f)
|
||||||
f.add_missing_feeds()
|
f.add_missing_feeds()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def add_missing_feeds_for_user(cls, user_id):
|
||||||
|
user = User.objects.get(pk=user_id)
|
||||||
|
try:
|
||||||
|
usf = UserSubscriptionFolders.objects.get(user=user)
|
||||||
|
except UserSubscriptionFolders.DoesNotExist:
|
||||||
|
return
|
||||||
|
|
||||||
|
usf.add_missing_feeds()
|
||||||
|
|
||||||
def add_missing_feeds(self):
|
def add_missing_feeds(self):
|
||||||
all_feeds = self.flat()
|
all_feeds = self.flat()
|
||||||
|
|
|
@ -26,5 +26,7 @@
|
||||||
|
|
||||||
<p><a href="https://turntouch.com/kickstarter">Turn Touch is on Kickstarter</a>. Back the project to get your very own. Or—and this is my sincere recommendation—get the complete set, save some money, and give one away to a friend.</p>
|
<p><a href="https://turntouch.com/kickstarter">Turn Touch is on Kickstarter</a>. Back the project to get your very own. Or—and this is my sincere recommendation—get the complete set, save some money, and give one away to a friend.</p>
|
||||||
|
|
||||||
|
<p>I've been working on Turn Touch for years and I hope it shows.</p>
|
||||||
|
|
||||||
<p style="text-align: center;"><a href="https://turntouch.com/kickstarter"><img src="https://turntouch.com/static/images/kickstarter/email-kickstarter-button@2x.png" style="width: 400px;height: 60px;margin: 0 auto;"></a></p>
|
<p style="text-align: center;"><a href="https://turntouch.com/kickstarter"><img src="https://turntouch.com/static/images/kickstarter/email-kickstarter-button@2x.png" style="width: 400px;height: 60px;margin: 0 auto;"></a></p>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Add table
Reference in a new issue