diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 01a08d95..35449aad 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1187,7 +1187,9 @@ module ApplicationHelper end res rescue Exception => e - Rails.logger.error("post failed! #{e}") + Rails.logger.error("post failed! #{e.message}") + # 增加错误栈信息 + e.backtrace.each { |msg| Rails.logger.error("post_backtrace: #{msg}") } raise("实训云平台繁忙(繁忙等级:#{status})") end end @@ -1198,7 +1200,7 @@ module ApplicationHelper res = Net::HTTP.get_response(uri).body res = JSON.parse(res) rescue => e - logger.error("get response failed ! #{e}") + logger.error("get response failed ! #{e.message}") raise("实训云平台繁忙(繁忙等级:84)") end end @@ -6578,7 +6580,7 @@ def update_shixun_work_status homework myshixuns = Myshixun.where(:shixun_id => shixun.id, :user_id => student_works.map(&:user_id)) myshixuns.each do |myshixun| work = student_works.where(:user_id => myshixun.user_id).first - member = homework.course.members.find_by(:user_id => work.user_id) + member = homework.course.members.find_by_user_id(work.user_id) setting_time = homework_group_setting homework, member.try(:course_group_id) games = myshixun.games.where(:challenge_id => challeng_ids) myshixun_endtime = games.select{|game| game.status == 2}.size == games.size ? games.map(&:end_time).max : nil diff --git a/app/views/managements/_profession_index.html.erb b/app/views/managements/_profession_index.html.erb index f8f906b3..668aa0f1 100644 --- a/app/views/managements/_profession_index.html.erb +++ b/app/views/managements/_profession_index.html.erb @@ -37,13 +37,13 @@