项目删除记录日志

This commit is contained in:
xxq250 2024-09-27 14:27:36 +08:00
parent 75c61bfff5
commit d5a2580ae9
1 changed files with 1 additions and 0 deletions

View File

@ -253,6 +253,7 @@ class ProjectsController < ApplicationController
def destroy
if current_user.admin? || @project.manager?(current_user)
ActiveRecord::Base.transaction do
UserAction.create(action_id: @project.id, action_type: "DestroyProject", user_id: current_user.id, :ip => request.remote_ip, data_bank: @project.attributes.to_json)
close_fork_pull_requests_by(@project)
Gitea::Repository::DeleteService.new(@project.owner, @project.identifier,current_user.gitea_token).call
@project.destroy!