lms.djangoapps.support.views package#
Submodules#
lms.djangoapps.support.views.certificate module#
Certificate tool in the student support app.
- class lms.djangoapps.support.views.certificate.CertificatesSupportView(**kwargs)#
Bases:
ViewView for viewing and regenerating certificates for users.
This is used by the support team to re-issue certificates to users if something went wrong during the initial certificate generation, such as:
The user’s name was spelled incorrectly.
The user later earned a higher grade and wants it on their certificate and dashboard.
- The user accidentally received an honor code certificate because their
verification expired before certs were generated.
Most of the heavy lifting is performed client-side through API calls directly to the certificates app.
- get(request)#
Render the certificates support view.
lms.djangoapps.support.views.contact_us module#
Signle support contact view
lms.djangoapps.support.views.course_entitlements module#
Support tool for changing and granting course entitlements
lms.djangoapps.support.views.enrollments module#
Support tool for changing course enrollments.
- class lms.djangoapps.support.views.enrollments.EnrollmentSupportListView(**kwargs)#
Bases:
GenericAPIViewAllows viewing and changing learner enrollments by support staff.
- exclude_from_schema = True#
- get(request, username_or_email)#
Returns a list of enrollments for the given user, along with information about previous manual enrollment changes.
- static get_course_modes(course_key)#
Returns a list of all modes including expired modes for a given course id
- Parameters:
course_id (CourseKey) – Search for course modes for this course.
- Returns:
list of Mode
- static include_order_number(enrollment)#
For a provided enrollment data dictionary, include order_number from CourseEnrollmentAttribute if available.
From all the attributes of a course enrollment:
Filter order_number attributes namespaced under order
- Use the last/latest order number attr if multiple attrs found
This is to keep the usage consistent with get_order_attribute_value method in CourseEnrollment
- static include_verified_mode_info(enrollment_data, course_key)#
Add information about the verified mode for the given course_key, if that course has a verified mode.
- Parameters:
enrollment_data (dict) – Dictionary representing a single enrollment.
course_key (CourseKey) – The course which this enrollment belongs to.
- Returns:
None
- static manual_enrollment_data(enrollment_data, course_key)#
Returns serialized information about the manual enrollment belonging to this enrollment, if it exists.
- Parameters:
enrollment_data (dict) – Representation of a single course enrollment.
course_key (CourseKey) – The course for this enrollment.
- Returns:
If no manual enrollment change has been made. dict: Serialization of the latest manual enrollment change.
- Return type:
None
- patch(request, username_or_email)#
Allows support staff to alter a user’s enrollment.
- post(request, username_or_email)#
Allows support staff to create a user’s enrollment.
lms.djangoapps.support.views.feature_based_enrollments module#
Support tool for viewing course duration information
- class lms.djangoapps.support.views.feature_based_enrollments.FeatureBasedEnrollmentSupportAPIView(**kwargs)#
Bases:
GenericAPIViewSupport-only API View for getting feature based enrollment configuration details for a course.
- authentication_classes = (<class 'edx_rest_framework_extensions.auth.jwt.authentication.JwtAuthentication'>, <class 'rest_framework.authentication.SessionAuthentication'>)#
- get(request, course_id)#
Returns the duration config information if FBE is enabled. If FBE is not enabled, empty dict is returned.
- Example Request:
GET /support/feature_based_enrollment_details/<course_id>
- Example Response:
- {
“course_id”: <course_id>, “course_name”: “FBE course”, “gating_config”: {
“enabled”: true, “enabled_as_of”: “2030-01-01 00:00:00+00:00”, “reason”: “Site”
}, “duration_config”: {
“enabled”: true, “enabled_as_of”: “2030-01-01 00:00:00+00:00”, “reason”: “Site”
}
}
- permission_classes = (<class 'rest_framework.permissions.IsAuthenticated'>,)#
lms.djangoapps.support.views.index module#
Index view for the support app.
- lms.djangoapps.support.views.index.index(request)#
Render the support index view.
lms.djangoapps.support.views.manage_user module#
Support tool for disabling user accounts.
- class lms.djangoapps.support.views.manage_user.ManageUserDetailView(**kwargs)#
Bases:
GenericAPIViewAllows viewing and disabling learner accounts by support staff.
- exclude_from_schema = True#
- get(request, username_or_email)#
Returns details for the given user, along with information about its username and joining date.
- post(request, username_or_email)#
Allows support staff to disable a user’s account.
lms.djangoapps.support.views.onboarding_status module#
Views for Onboarding Status.
- class lms.djangoapps.support.views.onboarding_status.OnboardingView(**kwargs)#
Bases:
GenericAPIViewReturn most recent and originally verified onboarding exam status for a given user. Return 404 is user not found.
- get(request, username_or_email)#
- Example Request:
GET /support/onboarding_status/<username_or_email>
- Example Response:
- {
- “verified_in”: {
“onboarding_status”: “verified”, “onboarding_link”: “/courses/<course_id>/jump_to/<block_id>”, “expiration_date”: null, “onboarding_past_due”: false, “onboarding_release_date”: “2016-01-01T00:00:00+00:00”, “review_requirements_url”: “”, “course_id”: “<course_id>”, “enrollment_date”: “2021-12-29T14:30:18.895435Z”, “instructor_dashboard_link”: “/courses/<course_id>/instructor#view-special_exams”
}, “current_status”: {
“onboarding_status”: “other_course_approved”, “onboarding_link”: “/courses/<course_id>/jump_to/<block_id>”, “expiration_date”: “2023-12-29T15:52:28.245Z”, “onboarding_past_due”: false, “onboarding_release_date”: “2020-01-01T00:00:00+00:00”, “review_requirements_url”: “”, “course_id”: “<course_id>”, “enrollment_date”: “2021-12-29T15:58:29.489916Z”, “instructor_dashboard_link”: “/courses/<course_id>/instructor#view-special_exams”
}
}
lms.djangoapps.support.views.program_enrollments module#
Support tool for changing course enrollments.
- class lms.djangoapps.support.views.program_enrollments.LinkProgramEnrollmentSupportAPIView(**kwargs)#
Bases:
APIViewSupport-only API View for linking learner enrollments by support staff.
- authentication_classes = (<class 'edx_rest_framework_extensions.auth.jwt.authentication.JwtAuthentication'>, <class 'rest_framework.authentication.SessionAuthentication'>)#
- permission_classes = (<class 'rest_framework.permissions.IsAuthenticated'>,)#
- post(request)#
Links learner enrollments by support staff * Example Request:
POST / support / link_program_enrollments_details/
Sample Payload
- {
program_uuid: < program_uuid > , username_pair_text: ‘external_user_key,lms_username’
}
- Example Response:
- {
program_uuid: < program_uuid>, username_pair_text: ‘external_user_key,lms_username’ successes: ‘Success messages if Linkages are created’, errors: ‘Error messages if there is no linkages’
}
- class lms.djangoapps.support.views.program_enrollments.LinkProgramEnrollmentSupportView(**kwargs)#
Bases:
ViewAllows viewing and changing learner enrollments by support staff.
- exclude_from_schema = True#
- get(request)#
- post(request)#
Link the given program enrollments and lms users
- class lms.djangoapps.support.views.program_enrollments.ProgramEnrollmentInspector#
Bases:
objectA common class to provide functionality of search and display the program enrollments information of a learner for Program Inspector Views and APIViews.
- class lms.djangoapps.support.views.program_enrollments.ProgramEnrollmentsInspectorAPIView(**kwargs)#
Bases:
ProgramEnrollmentInspector,APIViewThe APIview to search and display the program enrollments information of a learner.
- authentication_classes = (<class 'edx_rest_framework_extensions.auth.jwt.authentication.JwtAuthentication'>, <class 'rest_framework.authentication.SessionAuthentication'>)#
- get(request)#
Based on the query string parameters passed through the GET request Search the data store for information about ProgramEnrollment and SSO linkage with the user. * Example Request:
- GET / support/program_enrollments_inspector_details?
edx_user=<edx_user>&org_key=<org_key>&external_user_key=<external_user_key>
- Example Response:
- {
- learner_program_enrollments: {
- “user”: {
“username”: “edx”, “email”: “edx@example.com”
}, “id_verification”: {
“status”: “none”, “error”: <error>, “should_display”: true, “status_date”: <status_date>, “verification_expiry”: <verification_expiry>
}, “enrollments”: [
- {
“created”: “2021-11-25T04:56:25”, “modified”: “2021-12-19T22:27:34”, “external_user_key”: “testuser”, “status”: “enrolled”, “program_uuid”: <program_uuid>, “program_course_enrollments”: [], “program_name”: <program_name>
}
], “user”: {
“external_user_key”: “testuser”
}
}, org_key: < org_key > errors: ‘Error messages for invalid query’
}
- permission_classes = (<class 'rest_framework.permissions.IsAuthenticated'>,)#
- class lms.djangoapps.support.views.program_enrollments.ProgramEnrollmentsInspectorView(**kwargs)#
Bases:
ProgramEnrollmentInspector,ViewThe view to search and display the program enrollments information of a learner.
- CONSOLE_TEMPLATE_PATH = 'support/program_enrollments_inspector.html'#
- exclude_from_schema = True#
- get(request)#
Based on the query string parameters passed through the GET request Search the data store for information about ProgramEnrollment and SSO linkage with the user.
- class lms.djangoapps.support.views.program_enrollments.SAMLProvidersWithOrg(**kwargs)#
Bases:
APIViewSupport-only API View for fetching a list of all organizations names which will be utilized as keys.
- get(request)#
The get request returns a list of all organizations names which will be utilized as keys. * Example Request:
GET /support/get_saml_providers/
- Example Response:
- [
‘test_org’, ‘donut_org’, ‘tri_org’
]
lms.djangoapps.support.views.sso_records module#
Views for SSO records.
- class lms.djangoapps.support.views.sso_records.SsoView(**kwargs)#
Bases:
GenericAPIViewReturns a list of SSO records for a given user. Sample response: Sample response: [
- {
“provider”: “tpa-saml”, “uid”: “new-channel:testuser”, “created”: “2022-03-02T04:41:33.145Z”, “modified”: “2022-03-15T11:28:17.809Z”, “extraData”: “{}”, “history”: [
- {
“uid”: “new-channel:testuser”, “provider”: “tpa-saml”, “created”: “2022-03-02T04:41:33.145Z”, “modified”: “2022-03-15T11:28:17.809Z”, “extraData”: “{}”, “history_date”: “2022-03-15T11:28:17.832Z”
}, {
“uid”: “default-channel:testuser”, “provider”: “tpa-saml”, “created”: “2022-03-02T04:41:33.145Z”, “modified”: “2022-03-10T12:28:32.720Z”, “extraData”: “{}”, “history_date”: “2022-03-15T11:12:02.420Z”
}
]
}
]
- get(request, username_or_email)#
lms.djangoapps.support.views.utils module#
Various utility methods used by support app views.
- lms.djangoapps.support.views.utils.get_course_duration_info(course_key)#
Fetch course duration information from database.
- lms.djangoapps.support.views.utils.validate_and_link_program_enrollments(program_uuid_string, linkage_text)#
Validate arguments, and if valid, call link_program_enrollments.
- Returns: (successes, errors)
where successes and errors are both list[str]