For the remove CCXMembership pull request (https://github.com/edx/edx-platform/pull/8986), we moved CCX key checks out of the templates to avoid having them anywhere. The way we did that was to modify the CourseOverview model to make that check only once.
For the remove CCXMembership pull request (https://github.com/edx/edx-platform/pull/8986), we moved CCX key checks out of the templates to avoid having them anywhere. The way we did that was to modify the CourseOverview model to make that check only once.
https://github.com/jazkarta/edx-platform/blob/remove-ccx-enrollment/openedx/core/djangoapps/content/course_overviews/models.py#L108
However, this is not a good long term solution. The ideal way to handle this would be as field overrides, which will require some refactoring.