Don't call (failing) policy selection if the exercise has no execution environment

This commit is contained in:
Maximilian Grundke
2016-05-07 16:16:30 +02:00
parent d97d92347c
commit 9f0e240f91

View File

@ -28,7 +28,7 @@ h1 = Exercise.model_name.human(count: 2)
tr data-id=exercise.id
td = exercise.title
td = link_to_if(policy(exercise.author).show?, exercise.author, exercise.author)
td = link_to_if(policy(exercise.execution_environment).show?, exercise.execution_environment, exercise.execution_environment)
td = link_to_if(exercise.execution_environment && policy(exercise.execution_environment).show?, exercise.execution_environment, exercise.execution_environment)
td = exercise.files.teacher_defined_tests.count
td = exercise.maximum_score
td.public data-value=exercise.public? = symbol_for(exercise.public?)