Exemplo n.º 1
0
def group_remove_member(request, group_id, user_name):
    try:
        group_id_int = int(group_id)
    except ValueError:
        return render_error(request, _(u"group id is not valid"))

    if not check_group_staff(group_id_int, request.user):
        raise Http404

    try:
        ccnet_threaded_rpc.group_remove_member(group_id_int, request.user.username, user_name)
        seafserv_threaded_rpc.remove_repo_group(group_id_int, user_name)
        messages.success(request, _(u"Operation succeeded."))
    except SearpcError, e:
        messages.error(request, _(u"Failed:%s") % e.msg)