mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-04 04:03:25 +08:00
FIX update devops process
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
class UsersController < ApplicationController
|
||||
include Devopsable
|
||||
|
||||
before_action :load_user, only: [:show, :homepage_info, :sync_token, :sync_gitea_pwd, :projects, :watch_users, :fan_users]
|
||||
before_action :check_user_exist, only: [:show, :homepage_info,:projects, :watch_users, :fan_users]
|
||||
before_action :require_login, only: %i[me list]
|
||||
before_action :require_login, only: %i[me list devops_authenticate devops]
|
||||
before_action :auto_load_project, only: %i[devops devops_authenticate]
|
||||
skip_before_action :check_sign, only: [:attachment_show]
|
||||
|
||||
def list
|
||||
@@ -177,7 +179,7 @@ class UsersController < ApplicationController
|
||||
def trustie_projects
|
||||
user_id = User.select(:id, :login).where(login: params[:login])&.first&.id
|
||||
projects = Project.visible
|
||||
|
||||
|
||||
projects = projects.joins(:members).where(members: { user_id: user_id })
|
||||
|
||||
search = params[:search].to_s.strip
|
||||
@@ -212,6 +214,19 @@ class UsersController < ApplicationController
|
||||
render_ok
|
||||
end
|
||||
|
||||
def devops
|
||||
@user = current_user
|
||||
limit_owner_can_devops!(user)
|
||||
@cloud_account = @user.dev_ops_cloud_account
|
||||
end
|
||||
|
||||
# devops 认证
|
||||
def devops_authenticate
|
||||
limit_owner_can_devops!(current_user)
|
||||
current_user.set_drone_step!(User::DEVOPS_VERIFIED)
|
||||
render_ok
|
||||
end
|
||||
|
||||
private
|
||||
def load_user
|
||||
@user = User.find_by_login(params[:id]) || User.find_by(id: params[:id])
|
||||
|
||||
Reference in New Issue
Block a user