def change_user_role(request, projectID, userID):
    # Gets the project, user and role whose IDs have been passed to this view (the role by POST) and passes them on to
    # the project_api method of the same name.
    p = project_api.get_project(projectID)
    user = User.objects.get(id=userID)

    # Get the role that was sent via the dropdown in the form.
    retrieved_role = (request.POST).get('user_role')
    # print retrieved_role # to console for debugging
    project_api.change_user_role(p, user, retrieved_role)
    return redirect('/requirements/projectdetail/' + projectID)
Ejemplo n.º 2
0
def change_user_role(request, projectID, userID):
    # Gets the project, user and role whose IDs have been passed to this view (the role
    # by POST) and passes them on to the project_api method of the same name.
    project = project_api.get_project(projectID)
    user = User.objects.get(id=userID)
    # print user.username #debug

    # Get the role that was sent via the dropdown in the form.
    retrieved_role = (request.POST).get('user_role')
    # print retrieved_role # to console for debugging
    project_api.change_user_role(project, user, retrieved_role)
    return redirect('/req/projectdetail/' + projectID)