@login_required
@permission_required("relaydomains.add_service")
@require_http_methods(["POST"])
def scan_for_services(request):
    try:
        Service.objects.load_from_master_cf()
    except __HOLE__ as e:
        return render_to_json_response([str(e)], status=500)

    return render_to_json_response(
        dict((srv.name, srv.id) for srv in Service.objects.all())
    )
dataset/ETHPy150Open tonioo/modoboa/modoboa/relaydomains/views.py/scan_for_services