Exemplo n.º 1
0
from mygpo.subscriptions.signals import subscription_changed
from mygpo.suggestions.tasks import update_suggestions


def update_suggestions_on_subscription(sender, **kwargs):
    """ update a user's suggestions after one of his subscriptions change """
    user = kwargs['user']
    update_suggestions.delay(user)


subscription_changed.connect(update_suggestions_on_subscription,
                             dispatch_uid='update_suggestions_on_subscription')
Exemplo n.º 2
0
from mygpo.subscriptions.signals import subscription_changed
from mygpo.users.tasks import sync_user


def sync_user_on_subscription(sender, **kwargs):
    """ synchronizes the user after one of his subscriptions has changed """
    user = kwargs['user']
    sync_user.delay(user)


subscription_changed.connect(sync_user_on_subscription,
                             dispatch_uid='sync_user_on_subscription')
Exemplo n.º 3
0
 def ready(self):
     Podcast = apps.get_model('podcasts.Podcast')
     subscription_changed.connect(update_suggestions_on_subscription,
                                  sender=Podcast)
Exemplo n.º 4
0
 def ready(self):
     subscription_changed.connect(update_suggestions_on_subscription,
                                  sender=Podcast)
Exemplo n.º 5
0
 def ready(self):
     Podcast = apps.get_model('podcasts.Podcast')
     subscription_changed.connect(update_suggestions_on_subscription,
                                  sender=Podcast)