Exemplo n.º 1
0
def api_update_user_projects_by_id(id):
    user = users.get(id)
    user.projects = []
    for project in request.form.getlist("projects[]"):
        user.projects.append(projects.get(int(project)))
    users.save(user)
    return jsonify(dict(rc=0))
Exemplo n.º 2
0
def api_update_user_projects_by_id(id):
    user = users.get(id)
    user.projects = []
    for project in request.form.getlist("projects[]"):
        user.projects.append(projects.get(int(project)))
    users.save(user)
    return jsonify(dict(rc=0))
Exemplo n.º 3
0
def api_update_user_hosts_by_id(id):
    user = users.get(id)
    user.hosts = []
    for host in request.form.getlist("hosts[]"):
        user.hosts.append(hosts.get(int(host)))
    users.save(user)
    return jsonify(dict(rc=0))
Exemplo n.º 4
0
def api_update_user_hosts_by_id(id):
    user = users.get(id)
    user.hosts = []
    for host in request.form.getlist("hosts[]"):
        user.hosts.append(hosts.get(int(host)))
    users.save(user)
    return jsonify(dict(rc=0))