diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index b1eee18d..98b58614 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -3,7 +3,7 @@ class ManagementsController < ApplicationController before_filter :require_business before_filter :require_admin, :only => [:shixun_setting_list, :mirror_repository, :mirror_picture_shixuns, :editmd_template, :editmd_template, :subject_level_system, :subject_setting_list, - :shixun_authorization, :ec_template, :codemirror_template, :update_user, + :shixun_authorization, :ec_template, :codemirror_template, :course_guide_template, :shixun_quality_score, :tech_system, :update_notice, :setting_banner, :training_2018, :create_standard] layout 'base_management' diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8aa3b400..5737f99b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -628,7 +628,6 @@ module ApplicationHelper return end =end - user_e = UserExtensions.where(:user_id => User.current.id).first if !User.current.profile_completed? redirect_to my_account_path Rails.logger.info("check_authentication end") diff --git a/app/views/competitions/_qg_second_opensource.html.erb b/app/views/competitions/_qg_second_opensource.html.erb index 193e4d1c..8aef0390 100644 --- a/app/views/competitions/_qg_second_opensource.html.erb +++ b/app/views/competitions/_qg_second_opensource.html.erb @@ -17,6 +17,7 @@ first_stage = @competition.competition_stages.first first_section = first_stage.competition_stage_sections.first first_entry = first_section.competition_entries.first + second_entry = first_section.competition_entries.second is_start = Time.now > first_section.start_time competition_url = User.current.logged? ? "#{first_entry.url}?eid=#{User.current.id}" : "#{first_entry.url}" btn_url = is_start ? "#{competition_url}" : "javascript:void(0);" @@ -44,8 +45,8 @@ user_enrolled = false invite_code = nil - if first_entry.url.present? - course_id = first_entry.url.split('/')[-5, 1] + if first_entry.url.present? && second_entry.url.present? + course_id = second_entry.url course = Course.find_by_id(course_id) if course.present? && @user && @user.logged?