def layer_detail(request, catalog_slug, layer_uuid=None, layer_id=None): if layer_uuid is not None: layer = get_object_or_404(Layer, uuid=layer_uuid) else: layer = get_object_or_404(Layer, pk=layer_id) if request.method == 'POST': if 'check' in request.POST: if settings.REGISTRY_SKIP_CELERY: check_layer(layer.id) else: check_layer.delay(layer.id) if 'remove' in request.POST: layer.check_set.all().delete() if 'index' in request.POST: if settings.REGISTRY_SKIP_CELERY: index_layer(layer.id) else: index_layer.delay(layer.id) return render( request, 'aggregator/layer_detail.html', { 'layer': layer, 'SEARCH_TYPE': SEARCH_TYPE, 'SEARCH_URL': SEARCH_URL.rstrip('/'), 'catalog_slug': catalog_slug })
def layer_post_save(instance, *args, **kwargs): """ Used to do a layer full check when saving it. """ if not settings.SKIP_CELERY_TASK: check_layer.delay(instance) else: check_layer(instance)
def layer_detail(request, layer_id): layer = get_object_or_404(Layer, pk=layer_id) SOLR_URL = settings.SOLR_URL if request.method == 'POST': if 'check' in request.POST: if not settings.SKIP_CELERY_TASK: check_layer.delay(layer) else: check_layer(layer) if 'remove' in request.POST: layer.check_set.all().delete() if 'index' in request.POST: if not settings.SKIP_CELERY_TASK: index_layer.delay(layer) else: index_layer(layer) return render(request, 'aggregator/layer_detail.html', {'layer': layer, 'SOLR_URL': SOLR_URL})
def layer_detail(request, layer_id): layer = get_object_or_404(Layer, pk=layer_id) SOLR_URL = settings.SOLR_URL if request.method == 'POST': if 'check' in request.POST: if not settings.SKIP_CELERY_TASK: check_layer.delay(layer) else: check_layer(layer) if 'remove' in request.POST: layer.check_set.all().delete() if 'index' in request.POST: if not settings.SKIP_CELERY_TASK: index_layer.delay(layer) else: index_layer(layer) return render(request, 'aggregator/layer_detail.html', { 'layer': layer, 'SOLR_URL': SOLR_URL })
def layer_detail(request, catalog_slug, layer_id): layer = get_object_or_404(Layer, pk=layer_id, catalog__slug=catalog_slug) if request.method == 'POST': if 'check' in request.POST: if settings.REGISTRY_SKIP_CELERY: check_layer(layer) else: check_layer.delay(layer) if 'remove' in request.POST: layer.check_set.all().delete() if 'index' in request.POST: if settings.REGISTRY_SKIP_CELERY: index_layer(layer) else: index_layer.delay(layer) return render(request, 'aggregator/layer_detail.html', {'layer': layer, 'SEARCH_TYPE': SEARCH_TYPE, 'SEARCH_URL': SEARCH_URL.rstrip('/'), 'catalog_slug': catalog_slug})