

@decorators.json_view
@account_decorators.login_required
def spacecraft_valid_id(request):
    '\n    AJAX method for checking whether a given identifier is in use or not within\n    the database.\n    :param request: The GET HTTP request.\n    :return: \'{ isValid: "true/false", value: "$GET.value" }\n    '
    requested_id = request.GET['value']
    if (not requested_id):
        raise exceptions.BadRequest("'value' not found as a GET parameter.")
    is_valid = (not segments.Spacecraft.objects.filter(identifier=requested_id).exists())
    return {
        'isValid': is_valid,
        'value': requested_id,
    }

dataset/ETHPy150Open satnet-project/server/services/configuration/ajax/views.py spacecraft_valid_id/original