fix: don't show broken enroll link for staff on invite courses

Non-enrolled staff users were being shown enroll links for courses
that you can't self-enroll for (masters-only, invitation-only, etc).

This fixes the outline page to ignore staff status for that check.

AA-1164
This commit is contained in:
Michael Terry
2022-01-24 15:51:42 -05:00
parent 3eea5d9337
commit 44e799f60d
6 changed files with 29 additions and 25 deletions

View File

@@ -5,7 +5,6 @@ from django.utils.translation import gettext as _
from django.utils.translation import pgettext
from django.urls import reverse
from lms.djangoapps.courseware.courses import get_course_about_section
from lms.djangoapps.courseware.toggles import is_courses_default_invite_only_enabled
from django.conf import settings
from six import text_type
from common.djangoapps.edxmako.shortcuts import marketing_link
@@ -90,7 +89,7 @@ from six import string_types
<span class="register disabled">
${_("Course is full")}
</span>
% elif (is_courses_default_invite_only_enabled() or invitation_only) and not can_enroll:
% elif invitation_only and not can_enroll:
<span class="register disabled">${_("Enrollment in this course is by invitation only")}</span>
## Shib courses need the enrollment button to be displayed even when can_enroll is False,
## because AnonymousUsers cause can_enroll for shib courses to be False, but we need them to be able to click