mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
cla fix and add token verify
This commit is contained in:
@@ -11,14 +11,16 @@ class Users::ClasController < Users::BaseController
|
||||
|
||||
def create
|
||||
@user_cla = current_user.user_clas.find_by(cla_id: params[:cla_id])
|
||||
if @user_cla
|
||||
@user_cla.update_attributes(state: 1)
|
||||
else
|
||||
if @user_cla.nil?
|
||||
ActiveRecord::Base.transaction do
|
||||
Users::UserClaForm.new(user_cla_params).validate!
|
||||
@user_cla = UserCla.build(user_cla_params, current_user.id)
|
||||
|
||||
end
|
||||
elsif @user_cla.state == "failed"
|
||||
@user_cla.update_by_params(user_cla_params)
|
||||
elsif @user_cla.state == "signed"
|
||||
return render_error('协议生效中,请勿重复签署')
|
||||
end
|
||||
render_ok
|
||||
rescue Exception => e
|
||||
|
||||
Reference in New Issue
Block a user