FIX unbind devops bug
This commit is contained in:
parent
9a9540ad50
commit
6df01dead1
|
@ -55,14 +55,10 @@ module Ci::CloudAccountManageable
|
|||
|
||||
def unbind_account!
|
||||
cloud_account = current_user.ci_cloud_account
|
||||
return render_error('你未绑定CI服务器') if current_user.devops_step == User::DEVOPS_UNINIT || cloud_account.blank?
|
||||
|
||||
if current_user.devops_step == User::DEVOPS_UNINIT || cloud_account.blank?
|
||||
return render_error('你未绑定CI服务器')
|
||||
elsif current_user.ci_certification?
|
||||
cloud_account.destroy!
|
||||
# TOTO drop drone database
|
||||
@connection.execute("DROP DATABASE IF EXISTS #{current_user.login}_drone")
|
||||
end
|
||||
cloud_account.destroy! unless cloud_account.blank?
|
||||
@connection.execute("DROP DATABASE IF EXISTS #{current_user.login}_drone") # TOTO drop drone database
|
||||
|
||||
current_user.unbind_account!
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue