Skip to content

Commit

Permalink
[groups] ensure user is registered to the course if preview allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonygego committed Feb 24, 2022
1 parent 084e9a0 commit f84a3cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inginious/frontend/pages/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def GET_AUTH(self, courseid): # pylint: disable=arguments-differ
data = flask.request.args
if self.user_manager.has_staff_rights_on_course(course):
raise Forbidden(description=_("You can't access this page as a member of the staff."))
elif not self.user_manager.course_is_open_to_user(course, lti=False):
elif not (self.user_manager.course_is_open_to_user(course, lti=False)
and self.user_manager.course_is_user_registered(course, username)):
return self.template_helper.render("course_unavailable.html")
elif "register_group" in data:
if course.can_students_choose_group():
Expand Down

0 comments on commit f84a3cf

Please sign in to comment.