Browse Source

支持用户fork自己的仓库

pull/343/head
xxqfamous 3 years ago
parent
commit
d87a2fcd7e
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/controllers/forks_controller.rb

+ 1
- 1
app/controllers/forks_controller.rb View File

@@ -12,7 +12,7 @@ class ForksController < ApplicationController
def authenticate_project!
if current_user&.id == @project.user_id && (params[:new_identifier].blank? || params[:new_identifier] == @project.identifier)
render_result(-1, "自己不能fork自己的项目")
elsif Project.exists?(user_id: current_user.id, identifier: @project.identifier)
elsif Project.exists?(user_id: current_user.id, identifier: (params[:new_identifier] || @project.identifier))
render_result(0, "fork失败,你已拥有了这个项目")
end
# return if current_user != @project.owner


Loading…
Cancel
Save