File tree Expand file tree Collapse file tree
lms/djangoapps/instructor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ def _get_url(self, course_id=None):
118118 course_id = str (self .course_key )
119119 return reverse ('instructor_api_v2:course_metadata' , kwargs = {'course_id' : course_id })
120120
121+ @override_settings (COURSE_AUTHORING_MICROFRONTEND_URL = 'http://localhost:2001/authoring' )
121122 def test_get_course_metadata_as_instructor (self ):
122123 """
123124 Test that an instructor can retrieve comprehensive course metadata.
@@ -173,6 +174,9 @@ def test_get_course_metadata_as_instructor(self):
173174 self .assertIn ('has_ended' , data ) # noqa: PT009
174175 self .assertIn ('analytics_dashboard_message' , data ) # noqa: PT009
175176
177+ assert 'studio_grading_url' in data
178+ assert data ['studio_grading_url' ] == f'http://localhost:2001/authoring/course/{ self .course .id } /settings/grading'
179+
176180 def test_get_course_metadata_as_staff (self ):
177181 """
178182 Test that course staff can retrieve course metadata.
Original file line number Diff line number Diff line change 3232from lms .djangoapps .instructor .access import FORUM_ROLES , ROLES
3333from lms .djangoapps .instructor .views .instructor_dashboard import get_analytics_dashboard_message
3434from openedx .core .djangoapps .django_comment_common .models import FORUM_ROLE_ADMINISTRATOR
35+ from openedx .core .djangoapps .site_configuration import helpers as configuration_helpers
3536from xmodule .modulestore .django import modulestore
3637
3738from .tools import DashboardError , get_student_from_identifier , parse_datetime
@@ -454,7 +455,11 @@ def get_gradebook_url(self, data):
454455 def get_studio_grading_url (self , data ):
455456 """Get Studio MFE grading settings URL for the course."""
456457 course_key = data ['course' ].id
457- mfe_base_url = getattr (settings , 'COURSE_AUTHORING_MICROFRONTEND_URL' , None )
458+ mfe_base_url = configuration_helpers .get_value_for_org (
459+ course_key .org ,
460+ 'COURSE_AUTHORING_MICROFRONTEND_URL' ,
461+ settings .COURSE_AUTHORING_MICROFRONTEND_URL
462+ )
458463 if mfe_base_url :
459464 return f'{ mfe_base_url } /course/{ course_key } /settings/grading'
460465 return None
You can’t perform that action at this time.
0 commit comments