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.
25 lines
566 B
Python
25 lines
566 B
Python
"""
|
|
URL definitions for the course_modes v1 API.
|
|
"""
|
|
|
|
|
|
from django.conf import settings
|
|
from django.conf.urls import url
|
|
|
|
from course_modes.rest_api.v1 import views
|
|
|
|
app_name = 'v1'
|
|
|
|
urlpatterns = [
|
|
url(
|
|
r'^courses/{course_id}/$'.format(course_id=settings.COURSE_ID_PATTERN),
|
|
views.CourseModesView.as_view(),
|
|
name='course_modes_list'
|
|
),
|
|
url(
|
|
r'^courses/{course_id}/(?P<mode_slug>.*)$'.format(course_id=settings.COURSE_ID_PATTERN),
|
|
views.CourseModesDetailView.as_view(),
|
|
name='course_modes_detail'
|
|
),
|
|
]
|