示例#1
0
文件: util.py 项目: AthinaB/synnefo
def handle_valid_members_form(request, project_id, addmembers_form):
    if addmembers_form.is_valid():
        try:
            users = addmembers_form.valid_users
            for user in users:
                functions.enroll_member_by_email(project_id, user.email,
                                                 request_user=request.user)
        except functions.ProjectError as e:
            messages.error(request, e)
示例#2
0
def handle_valid_members_form(request, project_id, addmembers_form):
    if addmembers_form.is_valid():
        try:
            users = addmembers_form.valid_users
            for user in users:
                functions.enroll_member_by_email(project_id, user.email,
                                                 request_user=request.user)
        except functions.ProjectError as e:
            messages.error(request, e)
示例#3
0
def enroll_user(data, request_user):
    project_id = data.get("project")
    email = data.get("user")
    with ExceptionHandler():
        m = functions.enroll_member_by_email(project_id, email, request_user)

    response = {"id": m.id}
    return json_response(response)
示例#4
0
def enroll_user(data, request_user):
    project_id = data.get("project")
    email = data.get("user")
    with ExceptionHandler():
        m = functions.enroll_member_by_email(
            project_id, email, request_user)

    response = {"id": m.id}
    return json_response(response)
示例#5
0
文件: projects.py 项目: konsP/synnefo
def enroll_user(data, request_user):
    project_id = data.get("project")
    if not isinstance(project_id, (basestring, int)):
        raise faults.BadRequest("Invalid project ID: %s" % project_id)
    email = data.get("user")
    with ExceptionHandler():
        m = functions.enroll_member_by_email(project_id, email, request_user)

    response = {"id": m.id}
    return json_response(response)
示例#6
0
def enroll_user(data, request_user):
    project_id = data.get("project")
    if not isinstance(project_id, (basestring, int)):
        raise faults.BadRequest("Invalid project ID: %s" % project_id)
    email = data.get("user")
    with ExceptionHandler():
        m = functions.enroll_member_by_email(project_id, email, request_user)

    response = {"id": m.id}
    return json_response(response)