Exemplo n.º 1
0
def final_step_view(req, upload_session):
    try:
        saved_layer = upload.final_step(upload_session, req.user)

    except upload.LayerNotReady:
        return json_response({'status': 'pending',
                              'success': True,
                              'id': req.GET['id'],
                              'redirect_to': '/upload/final' + "?id=%s" % req.GET['id']})

    # this response is different then all of the other views in the
    # upload as it does not return a response as a json object
    _json_response = None
    try:
        _json_response = json_response(
            {
                'url': saved_layer.get_absolute_url(),
                'bbox': saved_layer.bbox_string,
                'crs': {
                    'type': 'name',
                    'properties': saved_layer.srid
                },
                'success': True
            }
        )
    except BaseException:
        _json_response = json_response(
            {'url': saved_layer.get_absolute_url(),
             'success': True
             }
        )
    return _json_response
Exemplo n.º 2
0
def final_step_view(req, upload_session):
    try:
        saved_layer = upload.final_step(upload_session, req.user)

    except upload.LayerNotReady:
        return json_response({
            'status':
            'pending',
            'success':
            True,
            'id':
            req.GET['id'],
            'redirect_to':
            '/upload/final' + "?id=%s" % req.GET['id']
        })

    # this response is different then all of the other views in the
    # upload as it does not return a response as a json object
    _json_response = None
    try:
        _json_response = json_response({
            'url': saved_layer.get_absolute_url(),
            'bbox': saved_layer.bbox_string,
            'crs': {
                'type': 'name',
                'properties': saved_layer.srid
            },
            'success': True
        })
    except BaseException:
        _json_response = json_response({
            'url': saved_layer.get_absolute_url(),
            'success': True
        })
    return _json_response
Exemplo n.º 3
0
def final_step_view(req, upload_session):
    saved_layer = upload.final_step(upload_session, req.user)
    # this response is different then all of the other views in the
    # upload as it does not return a response as a json object
    return json_response({
        'url': saved_layer.get_absolute_url(),
        'success': True
    })
Exemplo n.º 4
0
def final_step_view(req, upload_session):
    saved_layer = upload.final_step(upload_session, req.user)
    # this response is different then all of the other views in the
    # upload as it does not return a response as a json object
    return json_response(
        {'url': saved_layer.get_absolute_url(),
         'success': True
         }
    )
Exemplo n.º 5
0
def final_step_view(req, upload_session):
    try:
        saved_layer = upload.final_step(upload_session, req.user)

    except upload.LayerNotReady:
        return json_response({'status': 'pending',
                              'success': True,
                              'id': req.GET['id'],
                              'redirect_to': '/upload/final' + "?id=%s" % req.GET['id']})
Exemplo n.º 6
0
def final_step_view(req, upload_session):
    try:
        saved_layer = upload.final_step(upload_session, req.user)

    except upload.LayerNotReady:
        return json_response({"status": "pending", "success": True, "redirect_to": "/upload/final"})

    # this response is different then all of the other views in the
    # upload as it does not return a response as a json object
    return json_response(
        {"url": reverse("layer_upload_metadata", kwargs={"layername": saved_layer.typename}), "success": True}
    )
Exemplo n.º 7
0
def final_step_view(req, upload_session):
    try:
        saved_layer = upload.final_step(upload_session, req.user)

    except upload.LayerNotReady:
        return json_response({'status': 'pending',
                              'success': True,
                              'redirect_to': '/upload/final'})

    # this response is different then all of the other views in the
    # upload as it does not return a response as a json object
    return json_response(
        {'url': saved_layer.get_absolute_url(),
         'success': True
         }
    )
Exemplo n.º 8
0
def final_step_view(req, upload_session):
    try:
        saved_layer = upload.final_step(upload_session, req.user)

    except upload.LayerNotReady:
        return json_response({'status': 'pending',
                              'success': True,
                              'redirect_to': '/upload/final'})

    # this response is different then all of the other views in the
    # upload as it does not return a response as a json object
    return json_response(
        {'url': saved_layer.get_absolute_url(),
         'success': True
         }
    )
Exemplo n.º 9
0
def final_step_view(req, upload_session):
    try:
        saved_layer = upload.final_step(upload_session, req.user)

    except upload.LayerNotReady:
        return json_response(
            {
                "status": "pending",
                "success": True,
                "id": req.GET["id"],
                "redirect_to": "/upload/final" + "?id=%s" % req.GET["id"],
            }
        )

    # this response is different then all of the other views in the
    # upload as it does not return a response as a json object
    return json_response({"url": saved_layer.get_absolute_url(), "success": True})