Check RfC visibility before redirecting users

This commit is contained in:
Sebastian Serth
2023-02-21 10:01:01 +01:00
parent d0e4fcfa20
commit ddf041ac05
2 changed files with 6 additions and 6 deletions

View File

@ -21,7 +21,7 @@ module RedirectBehavior
return
end
rfc = @submission.own_unsolved_rfc
rfc = @submission.own_unsolved_rfc(current_user)
if rfc
# set a message that informs the user that his own RFC should be closed.
flash[:notice] = I18n.t('exercises.submit.full_score_redirect_to_own_rfc')
@ -36,7 +36,7 @@ module RedirectBehavior
end
# else: show open rfc for same exercise if available
rfc = @submission.unsolved_rfc
rfc = @submission.unsolved_rfc(current_user)
unless rfc.nil? || @embed_options[:disable_redirect_to_rfcs] || @embed_options[:disable_rfc]
# set a message that informs the user that his score was perfect and help in RFC is greatly appreciated.
flash[:notice] = I18n.t('exercises.submit.full_score_redirect_to_rfc')