@receiver(models.signals.post_save, sender=PriceCurrency, dispatch_uid='save_price_currency')
@receiver(models.signals.post_delete, sender=PriceCurrency, dispatch_uid='delete_price_currency')
def update_price_currency(sender, instance, **kw):
 if kw.get('raw'):
  return
 try:
  ids = list(instance.tier.addonpremium_set.values_list('addon_id', flat=True))
 except Price.DoesNotExist:
  return
 if ids:
  log.info('Indexing {0} add-ons due to PriceCurrency changes'.format(len(ids)))
  from mkt.webapps.tasks import index_webapps
  index_webapps.delay(ids)

@ receiver ( models . signals . post_save , sender = PriceCurrency , dispatch_uid = 'save_price_currency' ) @ receiver ( models . signals . post_delete , sender = PriceCurrency , dispatch_uid = 'delete_price_currency' ) def update_price_currency ( sender , instance , ** kw ) : if kw . get ( 'raw' ) : return try : ids = list ( instance . tier . addonpremium_set . values_list ( 'addon_id' , flat = True ) ) except Price . DoesNotExist : return if ids : log . info ( 'Indexing {0} add-ons due to PriceCurrency changes' . format ( len ( ids ) ) ) from mkt . webapps . tasks import index_webapps index_webapps . delay ( ids )
ensure that when pricecurrencies are updated .