Remove unused license preamble
[mygpo.git] / mygpo / data / apps.py
blob02ed423ca9df039d765eac03caf3fb1cac740d95
1 from django.apps import AppConfig
2 from mygpo.pubsub.signals import subscription_updated
4 import logging
5 logger = logging.getLogger(__name__)
8 def update_podcast(sender, **kwargs):
9 """ update podcast in background when receiving pubsub-notification """
10 from mygpo.data.tasks import update_podcasts
11 logger.info('updating podcast for "%s" after pubsub notification', sender)
12 update_podcasts.delay([sender])
15 class DataAppConfig(AppConfig):
16 name = 'mygpo.data'
18 def ready(self):
19 subscription_updated.connect(update_podcast,
20 dispatch_uid='update_podcast-pubsub')