解决部分路由不正确报500问题,让其跳转至404
This commit is contained in:
parent
1a2063fe7e
commit
dc6a515f08
|
@ -51,7 +51,12 @@ class OrgSubfieldsController < ApplicationController
|
||||||
@organization = Organization.find(params[:id])
|
@organization = Organization.find(params[:id])
|
||||||
else
|
else
|
||||||
domain = Secdomain.where("subname=?", request.subdomain).first
|
domain = Secdomain.where("subname=?", request.subdomain).first
|
||||||
@organization = Organization.find(domain.pid)
|
begin
|
||||||
|
@organization = Organization.find(domain.pid)
|
||||||
|
rescue
|
||||||
|
render_404
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if @organization.is_public? or User.current.admin? or User.current.member_of_org?(@organization)
|
if @organization.is_public? or User.current.admin? or User.current.member_of_org?(@organization)
|
||||||
@org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+
|
@org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+
|
||||||
|
|
Loading…
Reference in New Issue