修改fork的错误提示
This commit is contained in:
parent
cebab206b8
commit
2081ce11de
|
@ -8,8 +8,13 @@ class ForksController < ApplicationController
|
||||||
|
|
||||||
private
|
private
|
||||||
def authenticate_project!
|
def authenticate_project!
|
||||||
return if current_user != @project.owner
|
if current_user&.id == @project.user_id
|
||||||
render_result(-1, "自己不能fork自己的项目")
|
render_result(-1, "自己不能fork自己的项目")
|
||||||
|
elsif Project.exists?(user_id: current_user.id, identifier: @project.identifier)
|
||||||
|
render_result(-1, "fork失败,你已拥有了这个项目")
|
||||||
|
end
|
||||||
|
# return if current_user != @project.owner
|
||||||
|
# render_result(-1, "自己不能fork自己的项目")
|
||||||
end
|
end
|
||||||
|
|
||||||
def authenticate_user!
|
def authenticate_user!
|
||||||
|
|
Loading…
Reference in New Issue