def update_price_currency(sender, instance, **kw): """ Ensure that when PriceCurrencies are updated, all the apps that use them are re-indexed into ES so that the region information will be correct. """ if kw.get('raw'): return ids = list( instance.tier.addonpremium_set.values_list('addon_id', flat=True)) if ids: log.info('Indexing {0} add-ons due to PriceCurrency changes'.format( len(ids))) # Circular import sad face. from addons.tasks import index_addons index_addons.delay(ids)
def update_price_currency(sender, instance, **kw): """ Ensure that when PriceCurrencies are updated, all the apps that use them are re-indexed into ES so that the region information will be correct. """ if kw.get('raw'): return ids = list(instance.tier.addonpremium_set .values_list('addon_id', flat=True)) if ids: log.info('Indexing {0} add-ons due to PriceCurrency changes' .format(len(ids))) # Circular import sad face. from addons.tasks import index_addons index_addons.delay(ids)
@addon_view def app_review(request, addon): resp = None try: resp = _review(request, addon) except SigningError, exc: transaction.rollback() messages.error(request, 'Signing Error: %s' % exc) transaction.commit() return redirect( reverse('reviewers.apps.review', args=[addon.app_slug])) else: transaction.commit() # Temp. reindex the addon now it's been committed. if not settings.IN_TEST_SUITE and request.method == 'POST': index_addons.delay([addon.pk]) if resp: return resp raise QueuedApp = collections.namedtuple('QueuedApp', 'app created') def _queue(request, apps, tab, search_form=None, pager_processor=None): per_page = request.GET.get('per_page', QUEUE_PER_PAGE) pager = paginate(request, apps, per_page) searching, adv_searching = _check_if_searching(search_form) return jingo.render(request, 'reviewers/queue.html', context(**{
try: resp = _review(request, addon) except SigningError, exc: transaction.rollback() messages.error(request, 'Signing Error: %s' % exc) transaction.commit() return redirect(reverse('reviewers.apps.review', args=[addon.app_slug])) except Exception: transaction.rollback() raise else: transaction.commit() # Temp. reindex the addon now it's been committed. if not settings.IN_TEST_SUITE and request.method == 'POST': index_addons.delay([addon.pk]) transaction.commit() if resp: return resp raise QueuedApp = collections.namedtuple('QueuedApp', 'app created') def _queue(request, apps, tab, search_form=None, pager_processor=None): per_page = request.GET.get('per_page', QUEUE_PER_PAGE) pager = paginate(request, apps, per_page) return jingo.render( request, 'reviewers/queue.html',