diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 0c011a047..ee9696828 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -409,9 +409,10 @@ class GamesController < ApplicationController @answer = challenge.answer end - if challenge.shixun.status < 2 || @game.answer_open + if challenge.shixun.status < 2 || @game.answer_open || (challenge.st != 0 && @game.status == 2) @viewed = 1 else + @game.update_attributes(:answer_open => true) unless @game.answer_open if @score >= 0 @viewed = 2 else diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index b3aff125b..1fb024611 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -692,7 +692,7 @@ update # 顶部导航 @project_menu_type = 5 - entry_and_raw(false) + # entry_and_raw(false) @content = @repository.cat(@path, @rev) # @changesets_latest_coimmit = @g.commit(@project.gpid, @entry.try(:lastrev)) @changesets_latest_coimmit = @g.rep_last_changes(@shixun.gpid, :rev => @rev, :path => @path) @@ -934,6 +934,7 @@ update end rescue ActiveRecord::RecordNotFound render_404 + return rescue InvalidRevisionParam show_error_not_found end