1 from django
.dispatch
import receiver
3 from mygpo
.pubsub
.signals
import subscription_updated
4 from mygpo
.data
.tasks
import update_podcasts
7 logger
= logging
.getLogger(__name__
)
10 @receiver(subscription_updated
, dispatch_uid
='update_podcast-pubsub')
11 def update_podcast(sender
, **kwargs
):
12 """ update podcast in background when receiving pubsub-notification """
14 logger
.info('updating podcast for "%s" after pubsub notification', sender
)
15 update_podcasts
.delay([sender
])