diff --git a/lms/djangoapps/certificates/urls.py b/lms/djangoapps/certificates/urls.py index 9954a2c39d..af306e3caa 100644 --- a/lms/djangoapps/certificates/urls.py +++ b/lms/djangoapps/certificates/urls.py @@ -25,7 +25,7 @@ urlpatterns = [ # End-points used by student support # The views in the lms/djangoapps/support use these end-points # to retrieve certificate information and regenerate certificates. - url(r'search', views.search_certificates, name="search"), - url(r'regenerate', views.regenerate_certificate_for_user, name="regenerate_certificate_for_user"), - url(r'generate', views.generate_certificate_for_user, name="generate_certificate_for_user"), + url(r'^search', views.search_certificates, name="search"), + url(r'^regenerate', views.regenerate_certificate_for_user, name="regenerate_certificate_for_user"), + url(r'^generate', views.generate_certificate_for_user, name="generate_certificate_for_user"), ] diff --git a/lms/djangoapps/django_comment_client/base/urls.py b/lms/djangoapps/django_comment_client/base/urls.py index 042288e8ab..413a0cb8e2 100644 --- a/lms/djangoapps/django_comment_client/base/urls.py +++ b/lms/djangoapps/django_comment_client/base/urls.py @@ -6,34 +6,34 @@ from django.conf.urls import url from django_comment_client.base import views urlpatterns = [ - url(r'upload$', views.upload, name='upload'), - url(r'threads/(?P[\w\-]+)/update$', views.update_thread, name='update_thread'), - url(r'threads/(?P[\w\-]+)/reply$', views.create_comment, name='create_comment'), - url(r'threads/(?P[\w\-]+)/delete', views.delete_thread, name='delete_thread'), - url(r'threads/(?P[\w\-]+)/upvote$', views.vote_for_thread, {'value': 'up'}, name='upvote_thread'), - url(r'threads/(?P[\w\-]+)/downvote$', views.vote_for_thread, {'value': 'down'}, name='downvote_thread'), - url(r'threads/(?P[\w\-]+)/flagAbuse$', views.flag_abuse_for_thread, name='flag_abuse_for_thread'), - url(r'threads/(?P[\w\-]+)/unFlagAbuse$', views.un_flag_abuse_for_thread, + url(r'^upload$', views.upload, name='upload'), + url(r'^threads/(?P[\w\-]+)/update$', views.update_thread, name='update_thread'), + url(r'^threads/(?P[\w\-]+)/reply$', views.create_comment, name='create_comment'), + url(r'^threads/(?P[\w\-]+)/delete', views.delete_thread, name='delete_thread'), + url(r'^threads/(?P[\w\-]+)/upvote$', views.vote_for_thread, {'value': 'up'}, name='upvote_thread'), + url(r'^threads/(?P[\w\-]+)/downvote$', views.vote_for_thread, {'value': 'down'}, name='downvote_thread'), + url(r'^threads/(?P[\w\-]+)/flagAbuse$', views.flag_abuse_for_thread, name='flag_abuse_for_thread'), + url(r'^threads/(?P[\w\-]+)/unFlagAbuse$', views.un_flag_abuse_for_thread, name='un_flag_abuse_for_thread'), - url(r'threads/(?P[\w\-]+)/unvote$', views.undo_vote_for_thread, name='undo_vote_for_thread'), - url(r'threads/(?P[\w\-]+)/pin$', views.pin_thread, name='pin_thread'), - url(r'threads/(?P[\w\-]+)/unpin$', views.un_pin_thread, name='un_pin_thread'), - url(r'threads/(?P[\w\-]+)/follow$', views.follow_thread, name='follow_thread'), - url(r'threads/(?P[\w\-]+)/unfollow$', views.unfollow_thread, name='unfollow_thread'), - url(r'threads/(?P[\w\-]+)/close$', views.openclose_thread, name='openclose_thread'), - url(r'comments/(?P[\w\-]+)/update$', views.update_comment, name='update_comment'), - url(r'comments/(?P[\w\-]+)/endorse$', views.endorse_comment, name='endorse_comment'), - url(r'comments/(?P[\w\-]+)/reply$', views.create_sub_comment, name='create_sub_comment'), - url(r'comments/(?P[\w\-]+)/delete$', views.delete_comment, name='delete_comment'), - url(r'comments/(?P[\w\-]+)/upvote$', views.vote_for_comment, {'value': 'up'}, name='upvote_comment'), - url(r'comments/(?P[\w\-]+)/downvote$', views.vote_for_comment, {'value': 'down'}, + url(r'^threads/(?P[\w\-]+)/unvote$', views.undo_vote_for_thread, name='undo_vote_for_thread'), + url(r'^threads/(?P[\w\-]+)/pin$', views.pin_thread, name='pin_thread'), + url(r'^threads/(?P[\w\-]+)/unpin$', views.un_pin_thread, name='un_pin_thread'), + url(r'^threads/(?P[\w\-]+)/follow$', views.follow_thread, name='follow_thread'), + url(r'^threads/(?P[\w\-]+)/unfollow$', views.unfollow_thread, name='unfollow_thread'), + url(r'^threads/(?P[\w\-]+)/close$', views.openclose_thread, name='openclose_thread'), + url(r'^comments/(?P[\w\-]+)/update$', views.update_comment, name='update_comment'), + url(r'^comments/(?P[\w\-]+)/endorse$', views.endorse_comment, name='endorse_comment'), + url(r'^comments/(?P[\w\-]+)/reply$', views.create_sub_comment, name='create_sub_comment'), + url(r'^comments/(?P[\w\-]+)/delete$', views.delete_comment, name='delete_comment'), + url(r'^comments/(?P[\w\-]+)/upvote$', views.vote_for_comment, {'value': 'up'}, name='upvote_comment'), + url(r'^comments/(?P[\w\-]+)/downvote$', views.vote_for_comment, {'value': 'down'}, name='downvote_comment'), - url(r'comments/(?P[\w\-]+)/unvote$', views.undo_vote_for_comment, name='undo_vote_for_comment'), - url(r'comments/(?P[\w\-]+)/flagAbuse$', views.flag_abuse_for_comment, name='flag_abuse_for_comment'), - url(r'comments/(?P[\w\-]+)/unFlagAbuse$', views.un_flag_abuse_for_comment, + url(r'^comments/(?P[\w\-]+)/unvote$', views.undo_vote_for_comment, name='undo_vote_for_comment'), + url(r'^comments/(?P[\w\-]+)/flagAbuse$', views.flag_abuse_for_comment, name='flag_abuse_for_comment'), + url(r'^comments/(?P[\w\-]+)/unFlagAbuse$', views.un_flag_abuse_for_comment, name='un_flag_abuse_for_comment'), url(r'^(?P[\w\-.]+)/threads/create$', views.create_thread, name='create_thread'), url(r'^(?P[\w\-.]+)/follow$', views.follow_commentable, name='follow_commentable'), url(r'^(?P[\w\-.]+)/unfollow$', views.unfollow_commentable, name='unfollow_commentable'), - url(r'users$', views.users, name='users'), + url(r'^users$', views.users, name='users'), ] diff --git a/lms/djangoapps/grades/apps.py b/lms/djangoapps/grades/apps.py index 9c992ca178..1afd6748cd 100644 --- a/lms/djangoapps/grades/apps.py +++ b/lms/djangoapps/grades/apps.py @@ -20,7 +20,7 @@ class GradesConfig(AppConfig): PluginURLs.CONFIG: { ProjectType.LMS: { PluginURLs.NAMESPACE: u'grades_api', - PluginURLs.REGEX: u'api/grades/', + PluginURLs.REGEX: u'^api/grades/', PluginURLs.RELATIVE_PATH: u'api.urls', } }, diff --git a/lms/djangoapps/instructor/apps.py b/lms/djangoapps/instructor/apps.py index 4915213128..1f9c20e2b1 100644 --- a/lms/djangoapps/instructor/apps.py +++ b/lms/djangoapps/instructor/apps.py @@ -19,7 +19,7 @@ class InstructorConfig(AppConfig): PluginURLs.CONFIG: { ProjectType.LMS: { PluginURLs.NAMESPACE: u'', - PluginURLs.REGEX: u'courses/{}/instructor/api/'.format(COURSE_ID_PATTERN), + PluginURLs.REGEX: u'^courses/{}/instructor/api/'.format(COURSE_ID_PATTERN), PluginURLs.RELATIVE_PATH: u'views.api_urls', } }, diff --git a/lms/djangoapps/instructor/views/api_urls.py b/lms/djangoapps/instructor/views/api_urls.py index 674c9419eb..759c2c25b9 100644 --- a/lms/djangoapps/instructor/views/api_urls.py +++ b/lms/djangoapps/instructor/views/api_urls.py @@ -50,27 +50,27 @@ urlpatterns = [ # Grade downloads... url(r'^list_report_downloads$', api.list_report_downloads, name='list_report_downloads'), - url(r'calculate_grades_csv$', api.calculate_grades_csv, name='calculate_grades_csv'), - url(r'problem_grade_report$', api.problem_grade_report, name='problem_grade_report'), + url(r'^calculate_grades_csv$', api.calculate_grades_csv, name='calculate_grades_csv'), + url(r'^problem_grade_report$', api.problem_grade_report, name='problem_grade_report'), # Financial Report downloads.. url(r'^list_financial_report_downloads$', api.list_financial_report_downloads, name='list_financial_report_downloads'), # Registration Codes.. - url(r'get_registration_codes$', api.get_registration_codes, name='get_registration_codes'), - url(r'generate_registration_codes$', api.generate_registration_codes, name='generate_registration_codes'), - url(r'active_registration_codes$', api.active_registration_codes, name='active_registration_codes'), - url(r'spent_registration_codes$', api.spent_registration_codes, name='spent_registration_codes'), + url(r'^get_registration_codes$', api.get_registration_codes, name='get_registration_codes'), + url(r'^generate_registration_codes$', api.generate_registration_codes, name='generate_registration_codes'), + url(r'^active_registration_codes$', api.active_registration_codes, name='active_registration_codes'), + url(r'^spent_registration_codes$', api.spent_registration_codes, name='spent_registration_codes'), # Reports.. - url(r'get_enrollment_report$', api.get_enrollment_report, name='get_enrollment_report'), - url(r'get_exec_summary_report$', api.get_exec_summary_report, name='get_exec_summary_report'), - url(r'get_course_survey_results$', api.get_course_survey_results, name='get_course_survey_results'), - url(r'export_ora2_data', api.export_ora2_data, name='export_ora2_data'), + url(r'^get_enrollment_report$', api.get_enrollment_report, name='get_enrollment_report'), + url(r'^get_exec_summary_report$', api.get_exec_summary_report, name='get_exec_summary_report'), + url(r'^get_course_survey_results$', api.get_course_survey_results, name='get_course_survey_results'), + url(r'^export_ora2_data', api.export_ora2_data, name='export_ora2_data'), # Coupon Codes.. - url(r'get_coupon_codes', api.get_coupon_codes, name='get_coupon_codes'), + url(r'^get_coupon_codes', api.get_coupon_codes, name='get_coupon_codes'), # spoc gradebook url(r'^gradebook$', gradebook_api.spoc_gradebook, name='spoc_gradebook'), @@ -78,7 +78,7 @@ urlpatterns = [ url(r'^gradebook/(?P[0-9]+)$', gradebook_api.spoc_gradebook, name='spoc_gradebook'), # Cohort management - url(r'add_users_to_cohorts$', api.add_users_to_cohorts, name='add_users_to_cohorts'), + url(r'^add_users_to_cohorts$', api.add_users_to_cohorts, name='add_users_to_cohorts'), # Certificates url(r'^generate_example_certificates$', api.generate_example_certificates, name='generate_example_certificates'), diff --git a/lms/urls.py b/lms/urls.py index 9c62d0d12c..5f5febae7e 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -103,9 +103,6 @@ urlpatterns = [ # Course API url(r'^api/courses/', include('course_api.urls')), - # Completion API - url(r'^api/completion/', include('completion.api.urls', namespace='completion_api')), - # User API endpoints url(r'^api/user/', include('openedx.core.djangoapps.user_api.urls')), @@ -875,7 +872,7 @@ urlpatterns += [ if settings.FEATURES.get('ENABLE_THIRD_PARTY_AUTH'): urlpatterns += [ url(r'', include('third_party_auth.urls')), - url(r'api/third_party_auth/', include('third_party_auth.api.urls')), + url(r'^api/third_party_auth/', include('third_party_auth.api.urls')), ] # Enterprise @@ -930,10 +927,10 @@ if settings.FEATURES.get('ENABLE_LTI_PROVIDER'): ] urlpatterns += [ - url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)), - url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)), - url(r'config/catalog', ConfigurationModelCurrentAPIView.as_view(model=CatalogIntegration)), - url(r'config/forums', ConfigurationModelCurrentAPIView.as_view(model=ForumsConfig)), + url(r'^config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)), + url(r'^config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)), + url(r'^config/catalog', ConfigurationModelCurrentAPIView.as_view(model=CatalogIntegration)), + url(r'^config/forums', ConfigurationModelCurrentAPIView.as_view(model=ForumsConfig)), ] if settings.DEBUG: diff --git a/openedx/core/djangoapps/bookmarks/apps.py b/openedx/core/djangoapps/bookmarks/apps.py index 7c60e201b4..0c55983afe 100644 --- a/openedx/core/djangoapps/bookmarks/apps.py +++ b/openedx/core/djangoapps/bookmarks/apps.py @@ -17,7 +17,7 @@ class BookmarksConfig(AppConfig): PluginURLs.CONFIG: { ProjectType.LMS: { PluginURLs.NAMESPACE: u'', - PluginURLs.REGEX: u'api/bookmarks/', + PluginURLs.REGEX: u'^api/bookmarks/', PluginURLs.RELATIVE_PATH: u'urls', } }, diff --git a/openedx/core/djangoapps/theming/apps.py b/openedx/core/djangoapps/theming/apps.py index 14199272d6..e0da5456b8 100644 --- a/openedx/core/djangoapps/theming/apps.py +++ b/openedx/core/djangoapps/theming/apps.py @@ -3,7 +3,7 @@ from django.apps import AppConfig from openedx.core.djangoapps.plugins.constants import ProjectType, PluginURLs -plugin_urls_config = {PluginURLs.NAMESPACE: u'theming', PluginURLs.REGEX: u'theming/'} +plugin_urls_config = {PluginURLs.NAMESPACE: u'theming', PluginURLs.REGEX: r'^theming/'} class ThemingConfig(AppConfig): diff --git a/openedx/features/announcements/apps.py b/openedx/features/announcements/apps.py index fb8fd6f6c7..86759024b6 100644 --- a/openedx/features/announcements/apps.py +++ b/openedx/features/announcements/apps.py @@ -15,7 +15,7 @@ class AnnouncementsConfig(AppConfig): PluginURLs.CONFIG: { ProjectType.LMS: { PluginURLs.NAMESPACE: u'announcements', - PluginURLs.REGEX: u'announcements/', + PluginURLs.REGEX: u'^announcements/', PluginURLs.RELATIVE_PATH: u'urls', } }, diff --git a/openedx/tests/completion_integration/test_views.py b/openedx/tests/completion_integration/test_views.py index 2d9bf789e1..0ffa7fe156 100644 --- a/openedx/tests/completion_integration/test_views.py +++ b/openedx/tests/completion_integration/test_views.py @@ -31,7 +31,7 @@ class CompletionBatchTestCase(CompletionWaffleTestMixin, ModuleStoreTestCase): Create the test data. """ super(CompletionBatchTestCase, self).setUp() - self.url = reverse('completion_api:v1:completion-batch') + self.url = reverse('completion:v1:completion-batch') # Enable the waffle flag for all tests self.override_waffle_switch(True)