Skip to content

Commit

Permalink
FIXUP fix class ExerciseVisiblePermissionBase
Browse files Browse the repository at this point in the history
  • Loading branch information
markkuriekkinen authored and EerikSaksi committed Sep 22, 2022
1 parent 2c8cd7b commit da30fda
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion exercise/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ def is_object_visible(self, request, view, exercise):
self.error_msg(_('EXERCISE_VISIBILITY_ERROR_NOT_VISIBLE'))
return False

if exercise.is_submittable and not exercise.course_module.have_exercises_been_opened():
if (
exercise.is_submittable
and not exercise.course_module.have_exercises_been_opened()
and not exercise.status in (
LearningObject.STATUS.ENROLLMENT,
LearningObject.STATUS.ENROLLMENT_EXTERNAL,
)):
self.error_msg(
format_lazy(
_('EXERCISE_VISIBILITY_ERROR_NOT_OPEN_YET -- {}'),
Expand Down

0 comments on commit da30fda

Please sign in to comment.