-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix: adjust studio_grading_url to use the correct URL #38415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
f6c4aab
7287090
e67d184
aa55375
0af0a4d
576bde8
1737f01
13ded48
de7f255
4c1bb47
bcabd18
0ae3b6a
9c238c7
2fbe12d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |
| from lms.djangoapps.instructor.access import FORUM_ROLES, ROLES | ||
| from lms.djangoapps.instructor.views.instructor_dashboard import get_analytics_dashboard_message | ||
| from openedx.core.djangoapps.django_comment_common.models import FORUM_ROLE_ADMINISTRATOR | ||
| from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers | ||
| from xmodule.modulestore.django import modulestore | ||
|
|
||
| from .tools import DashboardError, get_student_from_identifier, parse_datetime | ||
|
|
@@ -77,6 +78,9 @@ class CourseInformationSerializerV2(serializers.Serializer): | |
| studio_grading_url = serializers.SerializerMethodField( | ||
| help_text="URL to the Studio grading settings page for the course (null if not configured)" | ||
| ) | ||
| admin_console_url = serializers.SerializerMethodField( | ||
| help_text="URL to the admin console (requires instructor access and MFE configuration, null if not accessible)" | ||
| ) | ||
| permissions = serializers.SerializerMethodField(help_text="User permissions for instructor dashboard features") | ||
| tabs = serializers.SerializerMethodField(help_text="List of course tabs with configuration and display information") | ||
| disable_buttons = serializers.SerializerMethodField( | ||
|
|
@@ -462,10 +466,27 @@ def get_gradebook_url(self, data): | |
| def get_studio_grading_url(self, data): | ||
| """Get Studio MFE grading settings URL for the course.""" | ||
| course_key = data['course'].id | ||
| mfe_base_url = getattr(settings, 'COURSE_AUTHORING_MICROFRONTEND_URL', None) | ||
| if mfe_base_url: | ||
| return f'{mfe_base_url}/course/{course_key}/settings/grading' | ||
| return None | ||
| mfe_base_url = configuration_helpers.get_value( | ||
| 'COURSE_AUTHORING_MICROFRONTEND_URL', | ||
| getattr(settings, 'COURSE_AUTHORING_MICROFRONTEND_URL', None) | ||
| ) | ||
| if not mfe_base_url: | ||
| return None | ||
| return f'{mfe_base_url}/course/{course_key}/settings/grading' | ||
|
|
||
| def get_admin_console_url(self, data): | ||
| """Get admin console URL (requires instructor access and MFE configuration, null if not accessible).""" | ||
| request = data['request'] | ||
| has_instructor_access = has_access(request.user, 'instructor', data['course']) | ||
| mfe_base_url = configuration_helpers.get_value( | ||
| 'ADMIN_CONSOLE_MICROFRONTEND_URL', | ||
| getattr(settings, 'ADMIN_CONSOLE_MICROFRONTEND_URL', None) | ||
|
Comment on lines
+481
to
+483
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The I think we should add it to |
||
| ) | ||
|
|
||
| has_permissions = request.user.is_staff or has_instructor_access | ||
| if not mfe_base_url or not has_permissions: | ||
| return None | ||
| return f'{mfe_base_url}/authz' | ||
|
|
||
| def get_disable_buttons(self, data): | ||
| """Check if buttons should be disabled for large courses.""" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.