fix: owners not return 404
This commit is contained in:
parent
ebe893022f
commit
51356da7f3
|
@ -12,7 +12,7 @@ class OwnersController < ApplicationController
|
|||
|
||||
def show
|
||||
@owner = Owner.find_by(login: params[:id]) || Owner.find_by(id: params[:id])
|
||||
return render_not_found unless @owner.present?
|
||||
# return render_not_found unless @owner.present?
|
||||
# 组织
|
||||
if @owner.is_a?(Organization)
|
||||
return render_forbidden("没有查看组织的权限") if org_limited_condition || org_privacy_condition
|
||||
|
@ -20,7 +20,7 @@ class OwnersController < ApplicationController
|
|||
@is_admin = current_user.admin? || @owner.is_owner?(current_user.id)
|
||||
@is_member = @owner.is_member?(current_user.id)
|
||||
# 用户
|
||||
else
|
||||
elsif @owner.is_a?(User)
|
||||
#待办事项,现在未做
|
||||
if User.current.admin? || User.current.login == @owner.login
|
||||
@waiting_applied_messages = @owner.applied_messages.waiting
|
||||
|
@ -45,7 +45,6 @@ class OwnersController < ApplicationController
|
|||
@projects_common_count = user_projects.common.size
|
||||
@projects_mirrior_count = user_projects.mirror.size
|
||||
@projects_sync_mirrior_count = user_projects.sync_mirror.size
|
||||
puts @owner.as_json
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ if @owner.is_a?(Organization)
|
|||
json.can_create_project @can_create_project
|
||||
json.is_admin @is_admin
|
||||
json.is_member @is_member
|
||||
else
|
||||
elsif @owner.is_a?(User)
|
||||
json.partial! 'users/user', locals: { user: @owner }
|
||||
json.undo_messages @waiting_applied_messages.size
|
||||
json.undo_transfer_projects @common_applied_transfer_projects.size
|
||||
|
@ -21,4 +21,6 @@ else
|
|||
json.city @owner.show_location ? @owner.city : nil
|
||||
json.custom_department @owner.show_department ? @owner.custom_department : nil
|
||||
json.description @owner.description
|
||||
elsif
|
||||
json.nil
|
||||
end
|
Loading…
Reference in New Issue