Deny /implement without execution environment

Also, fix a smaller typo in the locales
This commit is contained in:
Sebastian Serth
2023-01-20 23:53:08 +01:00
parent 2679f5fa56
commit 234a4fe02b
4 changed files with 5 additions and 2 deletions

View File

@ -443,6 +443,7 @@ class ExercisesController < ApplicationController
if current_user.admin? || current_user.teacher?
redirect_to(@exercise, alert: t('exercises.implement.unpublished')) if @exercise.unpublished?
redirect_to(@exercise, alert: t('exercises.implement.no_files')) unless @exercise.files.visible.exists?
redirect_to(@exercise, alert: t('exercises.implement.no_execution_environment')) if @exercise.execution_environment.blank?
else
render_not_authorized
end