modify competition

dev_aliyun
p31729568 6 years ago
parent a60f4332b3
commit 0cd61133a7

@ -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?

Loading…
Cancel
Save