Refactor program type enrollment checks
Checking if a user was enrolled in a program type was using the `name` field which is subject to be translated. This change allows for us to check by the type's slug which will be constant. This also includes the addition of api.py files for the course_modes, catalog, and programs apps.
Showing
- common/djangoapps/course_modes/api.py 17 additions, 0 deletionscommon/djangoapps/course_modes/api.py
- common/djangoapps/course_modes/rest_api/__init__.py 0 additions, 0 deletionscommon/djangoapps/course_modes/rest_api/__init__.py
- common/djangoapps/course_modes/rest_api/serializers.py 0 additions, 0 deletionscommon/djangoapps/course_modes/rest_api/serializers.py
- common/djangoapps/course_modes/rest_api/urls.py 12 additions, 0 deletionscommon/djangoapps/course_modes/rest_api/urls.py
- common/djangoapps/course_modes/rest_api/v1/__init__.py 0 additions, 0 deletionscommon/djangoapps/course_modes/rest_api/v1/__init__.py
- common/djangoapps/course_modes/rest_api/v1/tests/__init__.py 0 additions, 0 deletionscommon/djangoapps/course_modes/rest_api/v1/tests/__init__.py
- common/djangoapps/course_modes/rest_api/v1/tests/test_views.py 2 additions, 3 deletions...n/djangoapps/course_modes/rest_api/v1/tests/test_views.py
- common/djangoapps/course_modes/rest_api/v1/urls.py 1 addition, 1 deletioncommon/djangoapps/course_modes/rest_api/v1/urls.py
- common/djangoapps/course_modes/rest_api/v1/views.py 1 addition, 1 deletioncommon/djangoapps/course_modes/rest_api/v1/views.py
- lms/urls.py 2 additions, 1 deletionlms/urls.py
- openedx/core/djangoapps/catalog/api.py 21 additions, 0 deletionsopenedx/core/djangoapps/catalog/api.py
- openedx/core/djangoapps/catalog/cache.py 4 additions, 0 deletionsopenedx/core/djangoapps/catalog/cache.py
- openedx/core/djangoapps/catalog/management/commands/cache_programs.py 18 additions, 0 deletions.../djangoapps/catalog/management/commands/cache_programs.py
- openedx/core/djangoapps/catalog/management/commands/tests/test_cache_programs.py 6 additions, 0 deletions.../catalog/management/commands/tests/test_cache_programs.py
- openedx/core/djangoapps/catalog/tests/test_utils.py 44 additions, 9 deletionsopenedx/core/djangoapps/catalog/tests/test_utils.py
- openedx/core/djangoapps/catalog/utils.py 24 additions, 0 deletionsopenedx/core/djangoapps/catalog/utils.py
- openedx/core/djangoapps/programs/api.py 30 additions, 0 deletionsopenedx/core/djangoapps/programs/api.py
- openedx/core/djangoapps/programs/tests/test_utils.py 5 additions, 5 deletionsopenedx/core/djangoapps/programs/tests/test_utils.py
- openedx/core/djangoapps/programs/utils.py 13 additions, 7 deletionsopenedx/core/djangoapps/programs/utils.py
Please register or sign in to comment