删除组员的时候同步gitlab数据

This commit is contained in:
huang 2017-08-17 17:27:35 +08:00
parent f2fe59ed0f
commit 7ec2cf834f
1 changed files with 5 additions and 0 deletions

View File

@ -163,8 +163,13 @@ class ShixunsController < ApplicationController
def collaborators_delete
user_id = params[:c_id]
gid = User.find(user_id).try(:gid)
shixun_member = ShixunMember.where(:user_id => user_id, :shixun_id => @shixun.id, :role => 2).first
shixun_member.delete
g = Gitlab.client
unless gid.nil?
g.remove_team_member(@shixun.gpid, gid)
end
@collaborators = @shixun.collaborators
respond_to do |format|
format.js