删除实训的访问问题

dev_haigong
daiao 6 years ago
parent 53bf69e4b4
commit ed87d56f6c

@ -465,7 +465,7 @@ class ChallengesController < ApplicationController
render_404 render_404
return return
else else
if (@shixun.status == 0 && !User.current.manager_of_shixun?(@shixun)) if (@shixun.status == 0 && !User.current.manager_of_shixun?(@shixun)) || @shixun.status == -1
render_403 render_403
return return
end end

@ -1215,7 +1215,7 @@ class ShixunsController < ApplicationController
# Find shixun of id params[:id] # Find shixun of id params[:id]
def find_shixun def find_shixun
@shixun = Shixun.find_by_identifier(params[:id]) @shixun = Shixun.find_by_identifier(params[:id])
render_404 if @shixun.nil? render_404 if @shixun.nil? || @shixun.status == -1
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
render_404 render_404
end end
@ -1362,4 +1362,8 @@ class ShixunsController < ApplicationController
def validation_email def validation_email
render_403 if User.current.mail.blank? render_403 if User.current.mail.blank?
end end
def validate_shixun
end
end end

Loading…
Cancel
Save